From c1accc2e5bd03c5c1516d99058e3e75241ae7f76 Mon Sep 17 00:00:00 2001 From: Junegunn Choi Date: Tue, 25 Feb 2025 10:12:19 +0900 Subject: [PATCH] Use '/' as path separator on MSYS2 Fix #4281 --- src/reader.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/reader.go b/src/reader.go index 679cb636..a71f9697 100644 --- a/src/reader.go +++ b/src/reader.go @@ -277,6 +277,9 @@ func (r *Reader) readFiles(roots []string, opts walkerOpts, ignores []string) bo ignoresFull := []string{} ignoresSuffix := []string{} sep := string(os.PathSeparator) + if _, ok := os.LookupEnv("MSYSTEM"); ok { + sep = "/" + } for _, ignore := range ignores { if strings.ContainsRune(ignore, os.PathSeparator) { if strings.HasPrefix(ignore, sep) {