diff options
author | Chet Ramey <chet.ramey@case.edu> | 2018-12-20 11:41:58 -0500 |
---|---|---|
committer | Chet Ramey <chet.ramey@case.edu> | 2018-12-20 11:41:58 -0500 |
commit | f250956cb2a8dca13fc0242affc225f9d6983604 (patch) | |
tree | 2df8e15963af786dc8efed1c91c4d823a3bf05bb /lib/glob/sm_loop.c | |
parent | 2ae59c1134a75d5778997b7202b15b0586283042 (diff) | |
download | bash-5.0-testing.tar.gz |
bash-5.0-rc1 releasebash-5.0-rc1bash-5.0-testing
Diffstat (limited to 'lib/glob/sm_loop.c')
-rw-r--r-- | lib/glob/sm_loop.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/glob/sm_loop.c b/lib/glob/sm_loop.c index 2de5acd3..cc14fb16 100644 --- a/lib/glob/sm_loop.c +++ b/lib/glob/sm_loop.c @@ -384,7 +384,7 @@ BRACKMATCH (p, test, flags) { register CHAR cstart, cend, c; register int not; /* Nonzero if the sense of the character class is inverted. */ - int brcnt, brchr, forcecoll; + int brcnt, brchr, forcecoll, isrange; INT pc; CHAR *savep; U_CHAR orig_test; @@ -519,6 +519,7 @@ BRACKMATCH (p, test, flags) } cstart = cend = FOLD (cstart); + isrange = 0; /* POSIX.2 2.8.3.1.2 says: `An expression containing a `[' that is not preceded by a backslash and is not part of a bracket @@ -573,10 +574,18 @@ BRACKMATCH (p, test, flags) c = FOLD (c); continue; } + isrange = 1; } +#if 0 /* TAG: bash-5.1 */ + if (isrange == 0 && test == cstart) + goto matched; + if (isrange && RANGECMP (test, cstart, forcecoll) >= 0 && RANGECMP (test, cend, forcecoll) <= 0) + goto matched; +#else if (RANGECMP (test, cstart, forcecoll) >= 0 && RANGECMP (test, cend, forcecoll) <= 0) goto matched; +#endif if (c == L(']')) break; |