From 69b52e40ab26e49a34e97a9824eadc5475ac9c23 Mon Sep 17 00:00:00 2001 From: Jakub Sztandera Date: Mon, 1 Aug 2016 13:21:30 +0100 Subject: [PATCH] cli: do ToSlash after EvalSymlinks to remove platform specific slashes License: MIT Signed-off-by: Jakub Sztandera --- commands/cli/parse.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/commands/cli/parse.go b/commands/cli/parse.go index 19da10785eac..e72014332114 100644 --- a/commands/cli/parse.go +++ b/commands/cli/parse.go @@ -397,11 +397,14 @@ func appendFile(fpath string, argDef *cmds.Argument, recursive, hidden bool) (fi fpath = cwd } - fpath = filepath.ToSlash(filepath.Clean(fpath)) + fpath = filepath.Clean(fpath) fpath, err := filepath.EvalSymlinks(fpath) if err != nil { return nil, err } + // Repeat ToSlash after EvalSymlinks as it turns path to platform specific + fpath = filepath.ToSlash(fpath) + stat, err := os.Lstat(fpath) if err != nil { return nil, err