Date: Tue, 18 Jul 2017 19:00:15 +0000 (UTC) From: Jilles Tjoelker <jilles@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321171 - head/bin/sh Message-ID: <201707181900.v6IJ0GdG095891@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: jilles Date: Tue Jul 18 19:00:15 2017 New Revision: 321171 URL: https://svnweb.freebsd.org/changeset/base/321171 Log: 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. Modified: head/bin/sh/options.c Modified: head/bin/sh/options.c ============================================================================== --- head/bin/sh/options.c Tue Jul 18 18:56:51 2017 (r321170) +++ head/bin/sh/options.c Tue Jul 18 19:00:15 2017 (r321171) @@ -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)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201707181900.v6IJ0GdG095891>