Date: Mon, 10 Aug 2015 11:48:26 +0800 From: Marcelo Araujo <araujobsdport@gmail.com> To: Bruce Evans <brde@optusnet.com.au> Cc: Ed Schouten <ed@nuxi.nl>, src-committers <src-committers@freebsd.org>, "svn-src-all@freebsd.org" <svn-src-all@freebsd.org>, "svn-src-head@freebsd.org" <svn-src-head@freebsd.org> Subject: Re: svn commit: r286266 - head/usr.bin/ypmatch Message-ID: <CAOfEmZhCoKhrcRK-AJsx_W8X9DSvw=BcYaTCZejvYH-24dhO4Q@mail.gmail.com> In-Reply-To: <20150810131627.F965@besplex.bde.org> References: <201508040234.t742YqQA045448@repo.freebsd.org> <CABh_MK=5O=TLQmwr%2BwrdJeBVK3ATma1S1yj1_4kv-en9LzVOyA@mail.gmail.com> <CAOfEmZgiuzVQY%2BxgnGmiRv=1OrkUqFLqfoS5V92_8XLExcTmLA@mail.gmail.com> <20150810131627.F965@besplex.bde.org>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --] Hi bde@ and ed@ I think the patch attached is the latest changes to bring it as it used to be before I synced the code with OpenBSD. Mostly all issues that you both pointed out were addressed. Could you both make a review and point to me if there is any issue still remain? Basically this patch address: - Remove the extra information at the usage(). - Add space between variables on while() and for(). - Remove the extra space in a if statement. - Remove the extra brackets. - s/Reason/reason/g. All the best. 2015-08-10 11:24 GMT+08:00 Bruce Evans <brde@optusnet.com.au>: > On Mon, 10 Aug 2015, Marcelo Araujo wrote: > > 2015-08-09 19:51 GMT+08:00 Ed Schouten <ed@nuxi.nl>: >> >> Hi Marcelo, >>> >>> 2015-08-04 4:34 GMT+02:00 Marcelo Araujo <araujo@freebsd.org>: >>> >>>> Sync the code with the OpenBSD version. >>>> >>> >>> That's a shame. It looks like improvements that we made to our version >>> have been undone because of this. >>> ... >>> Though the style(9) conformance of tool wasn't ideal, this change made it >>> worse. >>> >> >> Agree with you! >> >> These tools are original from OpenBSD, I'm trying first to sync the code >> and then will rework them. I will try to send it back to upstream(OpenBSD) >> as soon as I have time. >> > > In fact, the changes were more than half to back out FreeBSD cleanups by > syncing with the 1994 OpenBSD version. The cleanups were small (less > than 50 lines changed), and OpenBSD doesn't seem to have changed much > either. > > Bruce > -- -- Marcelo Araujo (__)araujo@FreeBSD.org \\\'',)http://www.FreeBSD.org <http://www.freebsd.org/> \/ \ ^ Power To Server. .\. /_) [-- Attachment #2 --] Index: ypmatch.c =================================================================== --- ypmatch.c (revision 286562) +++ ypmatch.c (working copy) @@ -68,12 +68,6 @@ fprintf(stderr, "%s\n%s\n", "usage: ypmatch [-kt] [-d domainname] key ... mapname", " ypmatch -x"); - fprintf(stderr, - "where\n" - "\tmapname may be either a mapname or a nickname for a map.\n" - "\t-k prints keys as well as values.\n" - "\t-t inhibits map nickname translation.\n" - "\t-x dumps the map nickname translation table.\n"); exit(1); } @@ -87,10 +81,10 @@ domainname = NULL; notrans = key = 0; - while ((c=getopt(argc, argv, "xd:kt")) != -1) + while ((c = getopt(argc, argv, "xd:kt")) != -1) switch (c) { case 'x': - for (i=0; i<sizeof ypaliases/sizeof ypaliases[0]; i++) + for (i = 0; i<sizeof ypaliases/sizeof ypaliases[0]; i++) printf("Use \"%s\" for \"%s\"\n", ypaliases[i].alias, ypaliases[i].name); @@ -108,16 +102,15 @@ usage(); } - if ((argc-optind) < 2 ) + if ((argc-optind) < 2) usage(); - if (domainname == NULL) { + if (domainname == NULL) yp_get_default_domain(&domainname); - } inmap = argv[argc-1]; if (notrans == 0) { - for (i=0; i<sizeof ypaliases/sizeof ypaliases[0]; i++) + for (i = 0; i<sizeof ypaliases/sizeof ypaliases[0]; i++) if (strcmp(inmap, ypaliases[i].alias) == 0) inmap = ypaliases[i].name; } @@ -137,7 +130,7 @@ case YPERR_YPBIND: errx(1, "not running ypbind"); default: - errx(1, "can't match key %s in map %s. Reason: %s", + errx(1, "can't match key %s in map %s. reason: %s", inkey, inmap, yperr_string(r)); rval = 1; break;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAOfEmZhCoKhrcRK-AJsx_W8X9DSvw=BcYaTCZejvYH-24dhO4Q>
