[net.bugs.4bsd] 4.[123]bsd csh && & & bug

ado@elsie.UUCP (Arthur David Olson) (04/02/86)

Index:	bin/csh/sh.parse.c

Description:
	Here's the bug as described in a list posted to the network by Mt. Xinu:
 > csh--bin			      ralph (Ralph Campbell)   23 May 83  
 >	The command `sleep 10 && sleep 5 &' will create a non-interruptable
 >	non-suspendable pipeline which is not run in background.  I can
 >	reliably reproduced the problem.  It seems to fail if (any) other
 >	commands besides sleep are used.
 >
 >    REPEAT BY:
 >	type `sleep 10 && sleep 5 &'

Repeat-By:
	See above.

Fix:
	These changes are to the 4.1bsd version of "sh.parse.c",
	in particular to the function "syn0".
	Changes are conditioned on "OLDVERSION".
	As always, the trade secret status of the code involved precludes a
	clearer posting.

    		...
    		case '&':
    			if (l != 0)
    				break;
    			if (p->word[1] == '&')
    				continue;
    			t1 = syn1(p1, p, flags);
    #ifdef OLDVERSION
    			if (t1->t_dtyp == TLST) {
    #else /* !OLDVERSION */
    			if (t1->t_dtyp == TLST ||
    			    t1->t_dtyp == TAND ||
    			    t1->t_dtyp == TOR) {
    #endif /* !OLDVERSION */
    				t = (struct command *) calloc(1, sizeof (*t));
    		...
--
	UUCP: ..decvax!seismo!elsie!ado		ARPA: elsie!ado@seismo.ARPA
	DEC, VAX, Elsie & Ado are Digital, Borden & Shakespeare trademarks.