double slashes can and do occur in practice, eg if user has an env var MYDIR=/path/to/foo/ and enters a path like $MYDIR/foo.txt ;
this is not uncommon practice, because ending dirs in / (eg MYDIR=/path/to/foo/ ) makes sense, and concatenating with / (eg $MYDIR/foo.txt) also makes sense in case user is not sure whether $MYDIR ended in a /
I can point to more stackoverflow issues pointing to how this does happen in practice, if needed
proposal
walkGlob shd probably simply call normalizedPath on the input pattern before further processing
the
//
in input pattern makes walkGlob not work; it should work, like other tools (eg: unixls
on cmdline, or os.walkFiles)output:
note
double slashes can and do occur in practice, eg if user has an env var
MYDIR=/path/to/foo/
and enters a path like$MYDIR/foo.txt
; this is not uncommon practice, because ending dirs in/
(egMYDIR=/path/to/foo/
) makes sense, and concatenating with/
(eg$MYDIR/foo.txt
) also makes sense in case user is not sure whether$MYDIR
ended in a/
I can point to more stackoverflow issues pointing to how this does happen in practice, if neededproposal
walkGlob shd probably simply call
normalizedPath
on the input pattern before further processing