NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: bin/48498



The following reply was made to PR bin/48498; it has been noted by GNATS.

From: Nat Sloss <nathanialsloss%yahoo.com.au@localhost>
To: "gnats-bugs" <gnats-bugs%netbsd.org@localhost>
Cc: 
Subject: Re: bin/48498
Date: Mon, 6 Jan 2014 16:23:54 +1100

 Hi,
 I noticed this same behavior in NetBSD 6.1.1
 
 It seems as though if you separate commands by newlines it returns in error
 as expected.  ie sh -c "true^Jdo" will return in error as it should so I think 
 that sh should do the same for ; as it does for the new line character.
 
 So I have the following patch I still have to test it thoroughly though.
 
 Index: bin/sh/parser.c
 ===================================================================
 RCS file: /cvsroot/src/bin/sh/parser.c,v
 retrieving revision 1.80
 diff -u -r1.80 parser.c
 --- bin/sh/parser.c    31 Aug 2011 16:24:55 -0000      1.80
 +++ bin/sh/parser.c    6 Jan 2014 05:14:16 -0000
 @@ -186,7 +186,7 @@
                switch (tok) {
                case TBACKGND:
                case TSEMI:
 -                      tok = readtoken();
 +                      tok = TNL;
                        /* fall through */
                case TNL:
                        if (tok == TNL) {
 
 NB: This patch is my own work which I submit under the NetBSD license.
 
 Regards,
 
 Nat. 
 


Home | Main Index | Thread Index | Old Index