When encountering files that can't be lstat'ed, simply ignore them instead of
terminating the entire globbing process. This is consistent with how directories
that can't be read are already silently ignored.
This fixes#1674.
Glob expansion should use os.Lstat rather than os.Stat so that broken
symlinks don't stop glob expansion. It's not the place of glob expansion
to decide if a particular path is good.
The symlink test cases and logic were borrowed from
pkg/mods/path/path_test.go.
Fixes#1240
I was looking at "TODO" comments that could be eliminated and noticed the
one preceding the sole use of `isDrive()`. Which caused me to notice its
implementation is broken. The `s[1] < 'z'` test should be `s[0] < 'z'`
I stumbled across a comment that began with "XXX". It was clearly meant as
a "TODO" comment. This changes all such occurrences. However, a few "XXX"
comments are ambiguous and a better prefix might be "WARNING". The "TODO"
prefix at least ensures someone, eventually, looks into the situation
and either rewords the comment or fixes the problem. This change means
everyone can assume searching for "// TODO" will find all such comments
rather than requiring they also know to search for "// XXX".
This allows filtering the wildcard expansion by path type. For example,
whether the path is a directory, regular file, or something else. So
instead of `find . -type f` you can now do `**[type:file]`.
Resolves#1015