--- - branch: netbsd-8 date: Sat Aug 25 11:45:40 UTC 2018 files: - new: 1.140.2.4 old: 1.140.2.3 path: src/bin/sh/eval.c pathrev: src/bin/sh/eval.c@1.140.2.4 type: modified id: 20180825T114540Z.8fb7a62fc0c12be4283fed3738bb156917d86255 log: "Pull up following revision(s) (requested by kre in ticket #982):\n\n\tbin/sh/eval.c: revision 1.157\n\nPR bin/42184 PR bin/52687 (detailing the same bug).\n\nFix \"command not found\" handling so that the error message\ngoes to stderr (after any redirections are applied).\n\nMore importantly, in\n\n\tfoo > /tmp/junk\n\n/tmp/junk should be created, before any attempt is made\nto execute (the assumed non-existing) \"foo\".\n\nAll this was always true for any command (not found command)\ncontaining a / in its name\n\n\tfoo/bar >/tmp/junk 2>>/tmp/errs\n\nwould have created /tmp/junk, then complained (in /tmp/errs)\nabout foo/bar not being found. Now that happens for ordinary\ncommands as well.\n\nThe fix (which I found when I saw differences between our\ncode and FreeBSD's, where, for the benefit of PR 42184,\nthis has been fixed, sometime in the past 9 years) is\nfrighteningly simple. Simply do not short circuit execution\n(or print any error) when the initial lookup fails to\nfind the command - it will fail anyway when we actually\ntry running it. The cost is a (seemingly unnecessary,\nexcept that it really is) fork in this case.\n\nThis is what I had been planning, but I expected it would\nbe much more difficult than it turned out....\n\nXXX pullup-8\n" module: src subject: 'CVS commit: [netbsd-8] src/bin/sh' unixtime: '1535197540' user: martin