On 6/19/14, 6:47 PM, Ian Kelling wrote: > The doc says "When matching a pathname, the slash character > must always be matched explicitly." Shortly thereafter, in the next > paragraph of the same section, GLOBIGNORE is described, which does not > treat / as special, but this is not mentioned, and is very unexpected to > me. Closer inspection, I see same language "filenames matching a > pattern" is used in both paragraphs, so I think some clarification is > needed.
The GLOBIGNORE matching code treats the patterns and strings to be matched as pathnames, and treats `/' specially (that is, it specifies FNM_PATHNAME to bash's internal version of fnmatch). If *a matches scratch/a, for example, that's a bug in the matching code I will have to identify and fix. None of `*', `?', or bracket expressions should match a slash. > And then, another bug or doc clarification. The various [:class:] forms > don't seem to work at all in GLOBIGNORE. Yeah, this is a different problem caused by an oversight. The colon in the bracket expression is being treated as a pattern delimiter. I've appended a patch that fixes this problem. Chet -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hippocrates Chet Ramey, ITS, CWRU c...@case.edu http://cnswww.cns.cwru.edu/~chet/
*** ../bash-4.3-patched/pathexp.c 2014-01-31 09:34:33.000000000 -0500 --- pathexp.c 2014-06-20 15:33:09.000000000 -0400 *************** *** 539,543 **** return 0; ! n = skip_to_delim (s, i, ":", SD_NOJMP|SD_EXTGLOB); t = substring (s, i, n); --- 539,543 ---- return 0; ! n = skip_to_delim (s, i, ":", SD_NOJMP|SD_EXTGLOB|SD_GLOB); t = substring (s, i, n);