From f250956cb2a8dca13fc0242affc225f9d6983604 Mon Sep 17 00:00:00 2001 From: Chet Ramey Date: Thu, 20 Dec 2018 11:41:58 -0500 Subject: bash-5.0-rc1 release --- lib/glob/sm_loop.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'lib/glob/sm_loop.c') 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; -- cgit v1.2.1