From owner-freebsd-bugs Tue Aug 24 0:49:10 1999 Delivered-To: freebsd-bugs@freebsd.org Received: from zabagek.ihf.rwth-aachen.de (zabagek.ihf.RWTH-Aachen.DE [134.130.90.60]) by hub.freebsd.org (Postfix) with ESMTP id 405CD14FD4 for ; Tue, 24 Aug 1999 00:48:55 -0700 (PDT) (envelope-from tg@zabagek.ihf.rwth-aachen.de) Received: (from tg@localhost) by zabagek.ihf.rwth-aachen.de (8.9.3/8.9.3) id JAA15320; Tue, 24 Aug 1999 09:48:02 +0200 (CEST) (envelope-from tg) To: Sheldon Hearn Cc: freebsd-bugs@FreeBSD.ORG Subject: Re: bin/13274: /bin/sh 'read' command does not work correctly References: <199908231350.GAA63612@freefall.freebsd.org> From: Thomas Gellekum In-Reply-To: Sheldon Hearn's message of "Mon, 23 Aug 1999 06:50:03 -0700 (PDT)" Date: 24 Aug 1999 09:48:01 +0200 Message-ID: Lines: 76 User-Agent: Gnus/5.070095 (Pterodactyl Gnus v0.95) XEmacs/20.4 (Emerald) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org Sheldon Hearn writes: > The following reply was made to PR bin/13274; it has been noted by GNATS. > > From: Sheldon Hearn > To: freebsd-gnats-submit@freebsd.org > Cc: > Subject: Re: bin/13274: /bin/sh 'read' command does not work correctly > Date: Mon, 23 Aug 1999 15:39:35 +0200 > > If you want to score OpenGroup brownie points, reverse the meaning of > the -e option and call it the option -r option. The OpenGroup Single If I don't receive any `nay's on this I'll commit it before the weekend, followed by a MFC shortly afterwards. tg Index: miscbltin.c =================================================================== RCS file: /home/ncvs/src/bin/sh/miscbltin.c,v retrieving revision 1.18.2.1 diff -u -r1.18.2.1 miscbltin.c --- miscbltin.c 1999/05/08 10:43:02 1.18.2.1 +++ miscbltin.c 1999/08/23 14:27:24 @@ -71,8 +71,8 @@ /* - * The read builtin. The -e option causes backslashes to escape the - * following character. + * The read builtin. The -r option causes backslashes to be treated like + * ordinary characters. * * This uses unbuffered input, which may be avoidable in some cases. */ @@ -85,7 +85,7 @@ char **ap; int backslash; char c; - int eflag; + char rflag; char *prompt; char *ifs; char *p; @@ -98,17 +98,17 @@ struct termios told, tnew; int tsaved; - eflag = 0; + rflag = 0; prompt = NULL; tv.tv_sec = -1; tv.tv_usec = 0; - while ((i = nextopt("ep:t:")) != '\0') { + while ((i = nextopt("rp:t:")) != '\0') { switch(i) { case 'p': prompt = optarg; break; - case 'e': - eflag = 1; + case 'r': + rflag = 1; break; case 't': tv.tv_sec = strtol(optarg, &tvptr, 0); @@ -184,7 +184,7 @@ STPUTC(c, p); continue; } - if (eflag && c == '\\') { + if (!rflag && c == '\\') { backslash++; continue; } To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message