From 8f91865e1b2f2df95fb4833babbd0a8fb26085c8 Mon Sep 17 00:00:00 2001 From: Zev Goldstein Date: Fri, 28 Oct 2016 11:42:27 -0400 Subject: path/filepath: fix Abs on Windows The filepath.Abs function in windows did not call Clean as the documentation claimed. This change not only fixes that behavior but also adjusts TestAbs to verify Abs calls Clean as documented. Fixes #17210 Change-Id: I20c5f5026042fd7bd9d929ff5b17c8b2653f8afe Reviewed-on: https://go-review.googlesource.com/32292 Reviewed-by: Alex Brainman Reviewed-by: Brad Fitzpatrick Run-TryBot: Alex Brainman TryBot-Result: Gobot Gobot --- src/path/filepath/path_windows.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/path/filepath/path_windows.go') diff --git a/src/path/filepath/path_windows.go b/src/path/filepath/path_windows.go index a74b6469a9..359703de26 100644 --- a/src/path/filepath/path_windows.go +++ b/src/path/filepath/path_windows.go @@ -106,7 +106,11 @@ func splitList(path string) []string { } func abs(path string) (string, error) { - return syscall.FullPath(path) + fullPath, err := syscall.FullPath(path) + if err != nil { + return "", err + } + return Clean(fullPath), nil } func join(elem []string) string { -- cgit v1.3-5-g9baa