summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorjilles <jilles@FreeBSD.org>2015-12-31 20:15:57 +0000
committerjilles <jilles@FreeBSD.org>2015-12-31 20:15:57 +0000
commitb8cae6c53bb98cfc07d21feaa7d74ffcf5e09bb2 (patch)
treee1ed3303c34f15208c61ca8b83b2b24cdf8c713d /bin
parentc3d7a5b30499e13ffd21909109aa59b196db6933 (diff)
downloadFreeBSD-src-b8cae6c53bb98cfc07d21feaa7d74ffcf5e09bb2.zip
FreeBSD-src-b8cae6c53bb98cfc07d21feaa7d74ffcf5e09bb2.tar.gz
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).
Diffstat (limited to 'bin')
-rw-r--r--bin/sh/expand.c20
1 files changed, 2 insertions, 18 deletions
diff --git a/bin/sh/expand.c b/bin/sh/expand.c
index 6d5819d..59ba549 100644
--- a/bin/sh/expand.c
+++ b/bin/sh/expand.c
@@ -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 arglist *arglist)
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 arglist *arglist)
}
} 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 arglist *arglist)
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 arglist *arglist)
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 arglist *arglist)
}
matchdot = 0;
p = start;
- while (*p == CTLQUOTEMARK)
- p++;
if (*p == CTLESC)
p++;
if (*p == '.')
@@ -1280,8 +1270,6 @@ patmatch(const char *pattern, const char *string)
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 *string)
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 *string)
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 *string)
wc = (unsigned char)c;
if (*p == '-' && p[1] != ']') {
p++;
- while (*p == CTLQUOTEMARK)
- p++;
if (*p == CTLESC)
p++;
if (localeisutf8) {
OpenPOWER on IntegriCloud