From owner-freebsd-bugs Mon Aug 23 6:11:24 1999 Delivered-To: freebsd-bugs@freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.ORG [204.216.27.21]) by hub.freebsd.org (Postfix) with ESMTP id 1B8C4156F8 for ; Mon, 23 Aug 1999 06:11:15 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.9.3/8.9.2) id GAA59061; Mon, 23 Aug 1999 06:10:02 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Date: Mon, 23 Aug 1999 06:10:02 -0700 (PDT) Message-Id: <199908231310.GAA59061@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org Cc: From: Thomas Gellekum Subject: Re: bin/13274: /bin/sh 'read' command does not work correctly Reply-To: Thomas Gellekum Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.org The following reply was made to PR bin/13274; it has been noted by GNATS. From: Thomas Gellekum To: aa8vb@ipass.net Cc: FreeBSD-gnats-submit@FreeBSD.ORG Subject: Re: bin/13274: /bin/sh 'read' command does not work correctly Date: 23 Aug 1999 14:13:38 +0200 aa8vb@ipass.net writes: > Please fix /bin/sh so that the default behavior of the "read" > command is such that it merges lines ending with a trailing '\' > (i.e. like it behaves now only if -e is specified). Thanks. What's the verdict of the sh gurus? If I understand SUSV2 correctly, Randall is right, and the standard conforming behaviour is to continue reading. In that case we should kill the `-e' flag (see diffs below), IMHO. tg Index: miscbltin.c =================================================================== RCS file: /home/ncvs/src/bin/sh/miscbltin.c,v retrieving revision 1.19 diff -u -r1.19 miscbltin.c --- miscbltin.c 1999/05/08 10:21:56 1.19 +++ miscbltin.c 1999/08/23 12:30:21 @@ -71,8 +71,7 @@ /* - * The read builtin. The -e option causes backslashes to escape the - * following character. + * The read builtin. * * This uses unbuffered input, which may be avoidable in some cases. */ @@ -85,7 +84,6 @@ char **ap; int backslash; char c; - int eflag; char *prompt; char *ifs; char *p; @@ -98,18 +96,14 @@ struct termios told, tnew; int tsaved; - eflag = 0; prompt = NULL; tv.tv_sec = -1; tv.tv_usec = 0; - while ((i = nextopt("ep:t:")) != '\0') { + while ((i = nextopt("p:t:")) != '\0') { switch(i) { case 'p': prompt = optarg; break; - case 'e': - eflag = 1; - break; case 't': tv.tv_sec = strtol(optarg, &tvptr, 0); if (tvptr == optarg) @@ -184,7 +178,7 @@ STPUTC(c, p); continue; } - if (eflag && c == '\\') { + if (c == '\\') { backslash++; continue; } To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message