From a2741722b86bda2d2076ecaceecf926395ef47c0 Mon Sep 17 00:00:00 2001 From: Theo de Raadt Date: Tue, 21 May 1996 21:32:45 +0000 Subject: teeny cleanup --- usr.bin/ypcat/Makefile | 3 +-- usr.bin/ypcat/ypcat.1 | 4 +++- usr.bin/ypcat/ypcat.c | 12 +++++++----- usr.bin/ypmatch/Makefile | 3 +-- usr.bin/ypmatch/ypmatch.1 | 4 +++- usr.bin/ypmatch/ypmatch.c | 12 ++++++++---- usr.bin/ypwhich/Makefile | 2 +- usr.bin/ypwhich/ypwhich.1 | 4 +++- usr.bin/ypwhich/ypwhich.c | 7 +++++-- 9 files changed, 32 insertions(+), 19 deletions(-) (limited to 'usr.bin') 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 @@ -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 @@ -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 @@ -62,6 +62,7 @@ struct ypalias { { "ethers", "ethers.byname" }, }; +void usage() { fprintf(stderr, "Usage:\n"); @@ -87,9 +88,8 @@ char **argv; int c, r, i; int rval; + domainname = NULL; notrans = key = 0; - yp_get_default_domain(&domainname); - while( (c=getopt(argc, argv, "xd:kt")) != -1) switch(c) { case 'x': @@ -114,6 +114,10 @@ char **argv; if( (argc-optind) < 2 ) usage(); + if (!domainname) { + yp_get_default_domain(&domainname); + } + inmap = argv[argc-1]; if (!notrans) { for(i=0; i + * Copyright (c) 1992, 1993 Theo de Raadt * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -31,7 +34,7 @@ */ #ifndef LINT -static char rcsid[] = "$Id: ypwhich.c,v 1.2 1996/04/24 21:39:56 deraadt Exp $"; +static char rcsid[] = "$Id: ypwhich.c,v 1.3 1996/05/21 21:32:44 deraadt Exp $"; #endif #include -- cgit v1.2.3