Repository navigation
12.0
-
BREAK: Various fixes to
!(...)patterns to more closely align to Bash. 100% Bash behavior is impossible with
regular expression, but behavior in many ways was improved, but there may be some surprising behavior changes.- FIX: Fix an
EXTGLOB/EXTMATCHinverse group,!(...), inside another group ignoring the rest of its
alternative and the text that follows the group, e.g.@(!(a)b)and@(x|!(a))bmatchedab. They now follow
the same rule as inverse groups that are not in a group. Inside+(...)and*(...)groups, the rest is the
remainder of the alternative and the text after the loop. The rest of the alternative was ignored since 7.0.1,
and the text after the group since 2.2.1. - FIX: Fix an
EXTGLOB/EXTMATCHinverse group,!(...), inside another inverse group not ending where the
text consumed by the outer group ends, e.g.!(!(a)|b)matchedaaand!(a!(b))matchedaba. This also
causedtranslate()withCAPTUREto match differently than without it for these patterns. This was a
regression in 7.0.1. - FIX: An
EXTGLOB/EXTMATCHinverse group,!(...), whose patterns can only match text up to some length,
e.g.!(foo),!(a|bc), or!(?(a)b), now matches any other text, whatever follows it, as it does in Bash.
For instance,!(foo)*.txtnow matchesfoo.txtandfoobar.txt,!(a)*matchesa, and+(!(foo))matches
foo. Inverse groups with patterns that can match text of any length, e.g.!(*.js), still need to know what
follows them and behave as before. Inverse groups inside other inverse groups follow the same rules, e.g.
!(!(a)|b)*matchesaandab,!(!(a)*)matches nothing, and!(a!(b)*)no longer matchesab. - FIX: An
EXTGLOB/EXTMATCHinverse group,!(...), whose patterns cannot match nothing can now match
nothing whenever the rest of the pattern matches, as it does in Bash, even when its patterns can match text of
any length. For instance,!(*.js)*and!(a*)*now match any name (following dot rules), where
!(*.js)*rejecteda.jsanda.json.
- FIX: Fix an
-
BREAK: Match Bash logic such that
@(*|.a).bcan match.bin an extended pattern if the pattern contains an
explicit leading.in one of the alternatives exists. In this scenario,*is allowed to match nothing before
.b, but*won't physically match the.. -
NEW: Generate tighter regular expressions with the same behavior.
-
FIX: A leading
*can no longer match nothing so that a literal dot can match the leading dot of a file name,
e.g.*.envno longer matches.envunlessDOTGLOB/DOTMATCHis enabled. This agrees with Bash, Python's
glob, andfnmatch, which already behaved this way. Use.*envto explicitly match hidden names. -
FIX: Fix
globandiglobmissing a file name without a directory part, e.g.a.txt, whendir_fdis file
descriptor0, which a directory can get when it is opened while standard input is closed. -
FIX: Fix
WcMatchreturning a file afterkillis called from a directory validation hook or its error
handler. -
FIX: Preserve bare drive roots such as
D:inWcMatchon Windows, so searches use that drive's current
directory instead of its root directory. -
FIX: Fix a
?or bracket expression after a leading*matching the leading dot of a file name, e.g.*?a
matching.a. -
FIX: Fix a wildcard in an
EXTGLOB/EXTMATCHgroup, such as?(old-)@(*), matching the leading dot of a file
name when the text before it, e.g. an optional group or the start of another group slot, matched nothing. Wildcards
in later iterations of a repeated group, e.g.+(.?|*)and.a., are no longer wrongly restricted. -
FIX: Fix an
EXTGLOB/EXTMATCH@(...)or+(...)group that can match nothing, e.g.@(?(a)),
+(*(a))or@(a|?(b)), letting a literal dot after it match the leading dot of a file name, e.g.
@(?(a)).hiddenmatching.hidden. Such a group must match something, so it can no longer be skipped to reach
the dot, as in Bash, unlessDOTGLOB/DOTMATCHis enabled or an alternative starts with a dot. -
FIX: Fix a
?or bracket expression at the start of a repeatedEXTGLOBgroup matching a path separator in
globmatchand related functions, e.g.+(?)matchinga/b. This was a regression in 11.0.1. -
FIX: Fix an
EXTGLOB/EXTMATCHgroup that is simplified to a different group type, e.g.@(+(b))or
@(!(b)), losing its meaning when it is then reduced into its parent group. Repeats and negations were dropped,
e.g.@(a|@(!(b)))matchedband notc, and!(@(+(a)))matchedaa. This was a regression in 11.0. -
FIX: Preserve byte file names when globbing with
dir_fd, including names requiring surrogate escaping. -
FIX: Use the same case-insensitive matching for literal and wildcard path components in
globandiglob,
including Unicode case equivalences. -
FIX: Preserve a terminal directory separator after
GLOBSTARpatterns inglobmatch,globfilter, and
translated patterns. Patterns such as**/anddir/**/no longer match regular files. -
FIX: Require the literal prefix of recursive
globandiglobpatterns such asfile/**to name a directory. -
FIX: Count duplicate exclusion expansions toward the shared pattern limit in compiled matchers and translation.
-
FIX: Treat an empty
root_dir(''orb'') as the current directory inglobandiglob, including when
the directory is selected withdir_fd. -
FIX: Fix
globandiglobreturning synthetic.and..matches withSCANDOTDIRwhen a directory
cannot be opened for scanning. -
FIX: Require
bracex3.2.1 which contains a number of brace related bug fixes.