From owner-svn-src-all@freebsd.org Thu Dec 31 20:15:58 2015 Return-Path: Delivered-To: svn-src-all@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 A3173A5606A; Thu, 31 Dec 2015 20:15:58 +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 5AB441E84; Thu, 31 Dec 2015 20:15:58 +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 tBVKFvxe034550; Thu, 31 Dec 2015 20:15:57 GMT (envelope-from jilles@FreeBSD.org) Received: (from jilles@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id tBVKFvqG034549; Thu, 31 Dec 2015 20:15:57 GMT (envelope-from jilles@FreeBSD.org) Message-Id: <201512312015.tBVKFvqG034549@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jilles set sender to jilles@FreeBSD.org using -f From: Jilles Tjoelker Date: Thu, 31 Dec 2015 20:15:57 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r293002 - head/bin/sh X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 31 Dec 2015 20:15:58 -0000 Author: jilles Date: Thu Dec 31 20:15:57 2015 New Revision: 293002 URL: https://svnweb.freebsd.org/changeset/base/293002 Log: sh: Remove redundant CTLQUOTEMARK checks. With the new expand.c code, the intermediate representation passed to the pathname generation code only contains CTLESC, not CTLQUOTEMARK. CTLQUOTEMARK now only occurs in the text of NARG nodes (output of the parser). Modified: head/bin/sh/expand.c Modified: head/bin/sh/expand.c ============================================================================== --- head/bin/sh/expand.c Thu Dec 31 20:00:53 2015 (r293001) +++ head/bin/sh/expand.c Thu Dec 31 20:15:57 2015 (r293002) @@ -1018,7 +1018,7 @@ static char expdir[PATH_MAX]; /* * Perform pathname generation and remove control characters. - * At this point, the only control characters should be CTLESC and CTLQUOTEMARK. + * At this point, the only control characters should be CTLESC. * The results are stored in the list dstlist. */ static void @@ -1083,8 +1083,6 @@ expmeta(char *enddir, char *name, struct if (*q == '!' || *q == '^') q++; for (;;) { - while (*q == CTLQUOTEMARK) - q++; if (*q == CTLESC) q++; if (*q == '/' || *q == '\0') @@ -1096,8 +1094,6 @@ expmeta(char *enddir, char *name, struct } } else if (*p == '\0') break; - else if (*p == CTLQUOTEMARK) - continue; else { if (*p == CTLESC) esc++; @@ -1112,8 +1108,6 @@ expmeta(char *enddir, char *name, struct if (enddir != expdir) metaflag++; for (p = name ; ; p++) { - if (*p == CTLQUOTEMARK) - continue; if (*p == CTLESC) p++; *enddir++ = *p; @@ -1130,8 +1124,6 @@ expmeta(char *enddir, char *name, struct if (start != name) { p = name; while (p < start) { - while (*p == CTLQUOTEMARK) - p++; if (*p == CTLESC) p++; *enddir++ = *p++; @@ -1160,8 +1152,6 @@ expmeta(char *enddir, char *name, struct } matchdot = 0; p = start; - while (*p == CTLQUOTEMARK) - p++; if (*p == CTLESC) p++; if (*p == '.') @@ -1280,8 +1270,6 @@ patmatch(const char *pattern, const char if (*q++ != *p++) goto backtrack; break; - case CTLQUOTEMARK: - continue; case '?': if (*q == '\0') return 0; @@ -1298,7 +1286,7 @@ patmatch(const char *pattern, const char break; case '*': c = *p; - while (c == CTLQUOTEMARK || c == '*') + while (c == '*') c = *++p; /* * If the pattern ends here, we know the string @@ -1342,8 +1330,6 @@ patmatch(const char *pattern, const char c = '['; goto dft; } - if (c == CTLQUOTEMARK) - continue; if (c == '[' && *p == ':') { found |= match_charclass(p, chr, &end); if (end != NULL) @@ -1360,8 +1346,6 @@ patmatch(const char *pattern, const char wc = (unsigned char)c; if (*p == '-' && p[1] != ']') { p++; - while (*p == CTLQUOTEMARK) - p++; if (*p == CTLESC) p++; if (localeisutf8) {