commit bash-20190111 snapshot

This commit is contained in:
Chet Ramey
2019-01-14 10:44:20 -05:00
parent 605528a7c0
commit 0e8fd32490
8 changed files with 63 additions and 7 deletions
+12 -2
View File
@@ -187,7 +187,7 @@ extglob_skipname (pat, dname, flags)
int flags;
{
char *pp, *pe, *t, *se;
int n, r, negate, wild;
int n, r, negate, wild, nullpat;
negate = *pat == '!';
wild = *pat == '*' || *pat == '?';
@@ -214,6 +214,11 @@ extglob_skipname (pat, dname, flags)
return r;
}
/* Is the extglob pattern between the parens the null pattern? The null
pattern can match nothing, so should we check any remaining portion of
the pattern? */
nullpat = pe >= (pat + 2) && pe[-2] == '(' && pe[-1] == ')';
/* check every subpattern */
while (t = glob_patscan (pp, pe, '|'))
{
@@ -305,7 +310,7 @@ wextglob_skipname (pat, dname, flags)
{
#if EXTENDED_GLOB
wchar_t *pp, *pe, *t, n, *se;
int r, negate, wild;
int r, negate, wild, nullpat;
negate = *pat == L'!';
wild = *pat == L'*' || *pat == L'?';
@@ -323,6 +328,11 @@ wextglob_skipname (pat, dname, flags)
return r;
}
/* Is the extglob pattern between the parens the null pattern? The null
pattern can match nothing, so should we check any remaining portion of
the pattern? */
nullpat = pe >= (pat + 2) && pe[-2] == L'(' && pe[-1] == L')';
/* check every subpattern */
while (t = glob_patscan_wc (pp, pe, '|'))
{