summaryrefslogtreecommitdiff
path: root/usr.bin/ypcat
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/ypcat')
-rw-r--r--usr.bin/ypcat/Makefile3
-rw-r--r--usr.bin/ypcat/ypcat.14
-rw-r--r--usr.bin/ypcat/ypcat.c12
3 files changed, 11 insertions, 8 deletions
diff --git a/usr.bin/ypcat/Makefile b/usr.bin/ypcat/Makefile
index 6cab8ff07c5..92a0c474cb6 100644
--- a/usr.bin/ypcat/Makefile
+++ b/usr.bin/ypcat/Makefile
@@ -1,5 +1,4 @@
-# from: @(#)Makefile 5.8 (Berkeley) 7/28/90
-# $Id: Makefile,v 1.1 1995/10/18 08:47:08 deraadt Exp $
+# $OpenBSD: Makefile,v 1.2 1996/05/21 21:32:39 deraadt Exp $
PROG= ypcat
diff --git a/usr.bin/ypcat/ypcat.1 b/usr.bin/ypcat/ypcat.1
index d35c83c7d33..6be7ec72519 100644
--- a/usr.bin/ypcat/ypcat.1
+++ b/usr.bin/ypcat/ypcat.1
@@ -1,3 +1,5 @@
+.\" $OpenBSD: ypcat.1,v 1.2 1996/05/21 21:32:40 deraadt Exp $
+.\" $NetBSD: ypcat.1,v 1.4 1996/05/13 02:43:36 thorpej Exp $
.\"
.\" Copyright (c) 1993 Winning Strategies, Inc.
.\" All rights reserved.
@@ -27,7 +29,7 @@
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
-.\" $Id: ypcat.1,v 1.1 1995/10/18 08:47:08 deraadt Exp $
+.\" $Id: ypcat.1,v 1.2 1996/05/21 21:32:40 deraadt Exp $
.\"
.Dd December 3, 1993
.Dt YPCAT 1
diff --git a/usr.bin/ypcat/ypcat.c b/usr.bin/ypcat/ypcat.c
index c72e7150a77..f82937068a5 100644
--- a/usr.bin/ypcat/ypcat.c
+++ b/usr.bin/ypcat/ypcat.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ypcat.c,v 1.3 1996/05/05 16:19:31 deraadt Exp $ */
+/* $OpenBSD: ypcat.c,v 1.4 1996/05/21 21:32:40 deraadt Exp $ */
/*
* Copyright (c) 1992, 1993, 1996 Theo de Raadt <deraadt@theos.com>
@@ -33,7 +33,7 @@
*/
#ifndef LINT
-static char rcsid[] = "$OpenBSD: ypcat.c,v 1.3 1996/05/05 16:19:31 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: ypcat.c,v 1.4 1996/05/21 21:32:40 deraadt Exp $";
#endif
#include <sys/param.h>
@@ -90,7 +90,7 @@ int
main(argc, argv)
char **argv;
{
- char *domain;
+ char *domain = NULL;
struct ypall_callback ypcb;
char *inmap;
extern char *optarg;
@@ -99,8 +99,6 @@ char **argv;
int c, r, i;
notrans = key = 0;
- yp_get_default_domain(&domain);
-
while( (c=getopt(argc, argv, "xd:kt")) != -1)
switch(c) {
case 'x':
@@ -125,6 +123,10 @@ char **argv;
if(optind + 1 != argc )
usage();
+ if (!domainname) {
+ yp_get_default_domain(&domainname);
+ }
+
inmap = argv[optind];
if (!notrans) {
for(i=0; i<sizeof ypaliases/sizeof ypaliases[0]; i++)