diff options
Diffstat (limited to 'usr.bin/ypcat/ypcat.c')
-rw-r--r-- | usr.bin/ypcat/ypcat.c | 12 |
1 files changed, 7 insertions, 5 deletions
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++) |