]> Cypherpunks repositories - gostls13.git/commit
path/filepath: fix escaped chars in Glob on non-Windows
authorDaniel Martí <mvdan@mvdan.cc>
Thu, 11 Jan 2018 20:23:22 +0000 (20:23 +0000)
committerDaniel Martí <mvdan@mvdan.cc>
Wed, 14 Feb 2018 11:47:59 +0000 (11:47 +0000)
commit03f27d5f581bac5b40f8c870a9b316d6c814c356
treea13667740250841d62271ff3eaedd9e68111adfd
parent821b04dafbc5e94223766b15622d9b7b38b2f576
path/filepath: fix escaped chars in Glob on non-Windows

Backslashes are ignored in Match and Glob on Windows, since those
collide with the separator character. However, they should still work in
both functions on other operating systems.

hasMeta did not reflect this logic - it always treated a backslash as a
non-special character. Do that only on Windows.

Assuming this is what the TODO was referring to, remove it. There are no
other characters that scanChunk treats especially.

Fixes #23418.

Change-Id: Ie0bd795812e0ed9d8c8c1bbc3137f29d960cba84
Reviewed-on: https://go-review.googlesource.com/87455
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/path/filepath/match.go
src/path/filepath/match_test.go