From owner-svn-src-head@freebsd.org Tue Jul 18 19:00:17 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3DD5ED9DAD5; Tue, 18 Jul 2017 19:00:17 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 0590280182; Tue, 18 Jul 2017 19:00:16 +0000 (UTC) (envelope-from jilles@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v6IJ0G5c095892; Tue, 18 Jul 2017 19:00:16 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v6IJ0GdG095891; Tue, 18 Jul 2017 19:00:16 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201707181900.v6IJ0GdG095891@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Tue, 18 Jul 2017 19:00:15 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r321171 - head/bin/sh X-SVN-Group: head X-SVN-Commit-Author: jilles X-SVN-Commit-Paths: head/bin/sh X-SVN-Commit-Revision: 321171 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 18 Jul 2017 19:00:17 -0000 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)