cli: do ToSlash after EvalSymlinks to remove platform specific slashes
License: MIT Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
Jakub Sztandera committed
Aug 1, 2016 at 13:21 UTC
40741eae19a645f9dec8c134fcb7a6b62196ee1a
1 file changed
+4
-1
commands/cli/parse.go
+4
-1
@@ -397,11 +397,14 @@ func appendFile(fpath string, argDef *cmds.Argument, recursive, hidden bool) (fi
397
fpath = cwd
398
}
399
400
- fpath = filepath.ToSlash(filepath.Clean(fpath))
400
+ fpath = filepath.Clean(fpath)
401
fpath, err := filepath.EvalSymlinks(fpath)
402
if err != nil {
403
return nil, err
404
}
405
+ // Repeat ToSlash after EvalSymlinks as it turns path to platform specific
406
+ fpath = filepath.ToSlash(fpath)
407
+
408
stat, err := os.Lstat(fpath)
409
if err != nil {
410
return nil, err