From fab15b104fd8b8032114bca20d5768c8af19156d Mon Sep 17 00:00:00 2001 From: jilles Date: Tue, 6 Oct 2009 22:00:14 +0000 Subject: sh: Send the "xyz: not found" message to redirected fd 2. This also fixes that trying to execute a non-regular file with a command name without '/' returns 127 instead of 126. The fix is rather simplistic: treat CMDUNKNOWN as if the command were found as an external program. The resulting fork is a bit wasteful but executing unknown commands should not be very frequent. PR: bin/137659 --- bin/sh/exec.c | 1 + 1 file changed, 1 insertion(+) (limited to 'bin/sh/exec.c') diff --git a/bin/sh/exec.c b/bin/sh/exec.c index 8107821..f9d3c22 100644 --- a/bin/sh/exec.c +++ b/bin/sh/exec.c @@ -429,6 +429,7 @@ loop: outfmt(out2, "%s: %s\n", name, strerror(e)); } entry->cmdtype = CMDUNKNOWN; + entry->u.index = 0; return; success: -- cgit v1.1