From owner-freebsd-hackers Sat Jun 2 1:50:43 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from ringworld.nanolink.com (ringworld.nanolink.com [195.24.48.13]) by hub.freebsd.org (Postfix) with SMTP id 5E4D137B422 for ; Sat, 2 Jun 2001 01:50:39 -0700 (PDT) (envelope-from roam@orbitel.bg) Received: (qmail 25762 invoked by uid 1000); 2 Jun 2001 08:49:36 -0000 Date: Sat, 2 Jun 2001 11:49:36 +0300 From: Peter Pentchev To: Garance A Drosihn Cc: Dima Dorfman , Peter Seebach , hackers@FreeBSD.ORG Subject: Re: Fixing documented bug in env(1) Message-ID: <20010602114936.C24747@ringworld.oblivion.bg> Mail-Followup-To: Garance A Drosihn , Dima Dorfman , Peter Seebach , hackers@FreeBSD.ORG References: <20010602041242.849893E33@bazooka.unixfreak.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: ; from drosih@rpi.edu on Sat, Jun 02, 2001 at 02:03:38AM -0400 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Sat, Jun 02, 2001 at 02:03:38AM -0400, Garance A Drosihn wrote: > At 9:12 PM -0700 6/1/01, Dima Dorfman wrote: > >Honestly, I don't care about this all that much. I'll > >let you and David debate this to your liking. If no > >consensus develops in the next few days, I'll just > >commit what I have now. > > For whatever it's worth, it seems more reasonable to me > to use '--' instead of '=='. Since '--' has NO equals > sign in it, it clearly can't be the setting of an > environment variable. > > It also strikes me that this might be another topic to > send thru freebsd-standards@bostonradio.org, as Posix > might have something to say about what's appropriate. ..or at the very least to -arch. FWIW, I, too, think that '--' would be a POLA-friendly choice. However, if '==' were chosen, the patch to env.c would have to be slightly modified, as attached. G'luck, Peter -- This would easier understand fewer had omitted. Index: env/env.c =================================================================== RCS file: /home/ncvs/src/usr.bin/env/env.c,v retrieving revision 1.5 diff -u -r1.5 env.c --- env/env.c 1999/08/27 08:59:31 1.5 +++ env/env.c 2001/06/02 08:47:31 @@ -71,8 +71,13 @@ default: usage(); } - for (argv += optind; *argv && (p = strchr(*argv, '=')); ++argv) + for (argv += optind; *argv && (p = strchr(*argv, '=')); ++argv) { + if (!strcmp(*argv, "==")) { + argv++; + break; + } (void)setenv(*argv, ++p, 1); + } if (*argv) { execvp(*argv, argv); err(1, "%s", *argv); @@ -86,6 +91,6 @@ usage() { (void)fprintf(stderr, - "usage: env [-] [-i] [name=value ...] [command]\n"); + "usage: env [-] [-i] [name=value ...] [==] [command]\n"); exit(1); } To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message