Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10 5/3/83; site root44.UUCP Path: utzoo!watmath!clyde!burl!ulysses!allegra!mit-eddie!godot!harvard!seismo!mcvax!ukc!kcl-cs!root44!aegl From: aegl@root44.UUCP (Tony Luck) Newsgroups: net.bugs.usg Subject: bug in Sys V 2.0 /bin/sh Message-ID: <5214@root44.UUCP> Date: Tue, 11-Dec-84 15:04:47 EST Article-I.D.: root44.5214 Posted: Tue Dec 11 15:04:47 1984 Date-Received: Fri, 14-Dec-84 05:37:45 EST Organization: Root Computers Ltd., London Lines: 51 The system V release 2.0 shell has introduced a bug that means that the following: $ zzzzz ; echo hello produces the message: zzzzz: not found rather than the expected: zzzzz: not found hello The problem is that after deciding that the command does not exist 'failed()' is called which after printing diagnostics calls 'exitsh()' which 'longjmp()'s back to main() without attempting to execute the rest of the current list. In xec.c at about line 112 change: ------------------------------------------------------------------------------- if (comtype == NOTFOUND) { pos = hashdata(cmdhash); if (pos == 1) failed(*com, notfound); else if (pos == 2) failed(*com, badexec); else failed(*com, badperm); break; } ------------------------------------------------------------------------------- to read: ------------------------------------------------------------------------------- if (comtype == NOTFOUND) { char *errstr; pos = hashdata(cmdhash); if (pos == 1) errstr = notfound; else if (pos == 2) errstr = badexec; else errstr = badperm; prp(); prs_cntl(*com); prs(colon); prs(errstr); newline(); exitval = 1; break; } ------------------------------------------------------------------------------- Tony Luck {ucbvax!unisoft,mcvax!ukc}!root44!aegl