aboutsummaryrefslogtreecommitdiff
path: root/src/path/filepath/path.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/path/filepath/path.go')
-rw-r--r--src/path/filepath/path.go17
1 files changed, 1 insertions, 16 deletions
diff --git a/src/path/filepath/path.go b/src/path/filepath/path.go
index b1f1bf0e3f..3d693f840a 100644
--- a/src/path/filepath/path.go
+++ b/src/path/filepath/path.go
@@ -15,7 +15,6 @@ import (
"errors"
"io/fs"
"os"
- "runtime"
"slices"
"sort"
"strings"
@@ -168,21 +167,7 @@ func Clean(path string) string {
out.append('.')
}
- if runtime.GOOS == "windows" && out.volLen == 0 && out.buf != nil {
- // If a ':' appears in the path element at the start of a Windows path,
- // insert a .\ at the beginning to avoid converting relative paths
- // like a/../c: into c:.
- for _, c := range out.buf {
- if os.IsPathSeparator(c) {
- break
- }
- if c == ':' {
- out.prepend('.', Separator)
- break
- }
- }
- }
-
+ postClean(&out) // avoid creating absolute paths on Windows
return FromSlash(out.string())
}