提交 c7399ac2 编写于 作者: Z zavla 提交者: Derek Parker

terminal: correctly gueses path separator used in source files paths (#1418)

Fixes an error in wrongly appending os.PathSeparator to source file path on Windows in case of path substitution config option.
上级 53957e9f
......@@ -264,7 +264,14 @@ func (t *Term) substitutePath(path string) string {
if t.conf == nil {
return path
}
separator := string(os.PathSeparator)
// On windows paths returned from headless server are as c:/dir/dir
// though os.PathSeparator is '\\'
separator := "/" //make it default
if strings.Index(path, "\\") != -1 { //dependent on the path
separator = "\\"
}
for _, r := range t.conf.SubstitutePath {
from := crossPlatformPath(r.From)
to := r.To
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册