[glob] gets implemented recursively and depending
on the switches and patterns can result in a whole
tree of calls to Tcl_FSMatchInDirectory(). If the
directories are named by relative paths, then they
are taken relative to the cwd - which is a process wide
value that can be changed at arbitrary times by
other threads in the process. This means that
some portions of the [glob] search might take
place with different [pwd] values than other portions,
and the assembled list of [glob] results does not
actually represent any properly functioning,
consistent filesystem search.
In concept, the fix would be to determine [pwd]
once at the beginning of the glob operation and
then take care to pass it down the whole tree
of operations for consistent results rooted on
/some/ consistent value of [pwd].
Low priority, I think, but wanted to record the
issue while I noticed it.
|