Skip to content

Commit 58d4d90

Browse files
committed
cmd: fix --match for Windows, see #901
1 parent 66bad8b commit 58d4d90

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

cmd/minify/main.go

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -624,11 +624,7 @@ func minifyWorker(chanTasks <-chan Task, chanFails chan<- int) {
624624
// compilePattern returns *regexp.Regexp or glob.Glob
625625
func compilePattern(pattern string) (*regexp.Regexp, error) {
626626
if len(pattern) == 0 || pattern[0] != '~' {
627-
sep := string(filepath.Separator)
628-
if sep == `\` {
629-
sep = `\\`
630-
}
631-
627+
sep := regexp.QuoteMeta(string(filepath.Separator))
632628
if strings.HasPrefix(pattern, `\~`) {
633629
pattern = pattern[1:]
634630
}

0 commit comments

Comments
 (0)