escape path separator on windows

This commit is contained in:
Gokcehan 2019-10-25 20:51:22 +03:00
parent 0482340d5e
commit 74ef9fcd83

View File

@ -262,7 +262,7 @@ func matchFile(s string) (matches []string, longest string) {
item := f.Name() item := f.Name()
if f.Mode().IsDir() { if f.Mode().IsDir() {
item += string(filepath.Separator) item += escape(string(filepath.Separator))
} }
matches = append(matches, item) matches = append(matches, item)
@ -272,7 +272,7 @@ func matchFile(s string) (matches []string, longest string) {
if f.Mode().IsRegular() { if f.Mode().IsRegular() {
longest = name + " " longest = name + " "
} else { } else {
longest = name + string(filepath.Separator) longest = name + escape(string(filepath.Separator))
} }
} }
} }