path/filepath: Glob fails and hangs on Windows when using character ranges #46338
Labels
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
OS-Windows
Milestone
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I am trying to get case insensitive results for
filepath.Glob()
on Windows. To do so, I'm transforming each letter in a character range for uppercase and lowercase. See #5441.What did you expect to see?
The same results as when using pattern exactly matching an existing file.
What did you see instead?
\\server\share\filename.ext
andc:\dir\filename.ext
are existing files.filepath.Glob(`c:\dir\filename.ext`)
correctly returns one result.filepath.Glob(`[Cc]:\[Dd][Ii][Rr]\[fF][iI][lL][eE][nN][aA][mM][eE].[eE][xX][tT]`)
returns no result, while it should return one result.filepath.Glob(`C:\[Dd][Ii][Rr]\[fF][iI][lL][eE][nN][aA][mM][eE].[eE][xX][tT]`)
correctly returns one result.filepath.Glob(`\\server\share\filename.ext`)
correctly returns one result.filepath.Glob(`\\[sS][eE][rR][vV][eE][rR]\[sS][hH][aA][rR][eE]\[fF][iI][lL][eE][nN][aA][mM][eE].[eE][xX][tT]`)
returns no result, while it should return one result.filepath.Glob(`\\server\share\[fF][iI][lL][eE][nN][aA][mM][eE].[eE][xX][tT]`)
correctly returns one result.filepath.Glob(`\\server\[sS][hH][aA][rR][eE]\[fF][iI][lL][eE][nN][aA][mM][eE].[eE][xX][tT]`)
hangs, and it should not.The text was updated successfully, but these errors were encountered: