diff options
author | Jilles Tjoelker <jilles@FreeBSD.org> | 2017-07-18 19:00:15 +0000 |
---|---|---|
committer | Jilles Tjoelker <jilles@FreeBSD.org> | 2017-07-18 19:00:15 +0000 |
commit | 93c3eab50c3c6fd68ff6ca5122ff75e5e60bb623 (patch) | |
tree | 6066dd5a5406b6d7271269acdfebbb14494f516e /bin/sh | |
parent | 8aea3ca0a7b214a094f8ab330b3f3b814e46aec1 (diff) | |
download | src-93c3eab50c3c6fd68ff6ca5122ff75e5e60bb623.tar.gz src-93c3eab50c3c6fd68ff6ca5122ff75e5e60bb623.zip |
sh: Remove broken #ifdef NOHACK code (related to sh -c).
Apart from the fact that subtle syntactic changes make a poor compile-time
option, the NOHACK case has been obviously broken since it was added,
because it uses q uninitialized if (*p != '\0').
No functional change is intended.
Notes
Notes:
svn path=/head/; revision=321171
Diffstat (limited to 'bin/sh')
-rw-r--r-- | bin/sh/options.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/bin/sh/options.c b/bin/sh/options.c index 2ac1a4bb46b0..d580436c134e 100644 --- a/bin/sh/options.c +++ b/bin/sh/options.c @@ -191,16 +191,11 @@ options(int cmdline) while ((c = *p++) != '\0') { if (c == 'c' && cmdline) { char *q; -#ifdef NOHACK /* removing this code allows sh -ce 'foo' for compat */ - if (*p == '\0') -#endif - q = *argptr++; + + q = *argptr++; if (q == NULL || minusc != NULL) error("Bad -c option"); minusc = q; -#ifdef NOHACK - break; -#endif } else if (c == 'o') { minus_o(*argptr, val); if (*argptr) |