diff options
Diffstat (limited to 'libgo/go/path/filepath/path_unix.go')
-rw-r--r-- | libgo/go/path/filepath/path_unix.go | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/libgo/go/path/filepath/path_unix.go b/libgo/go/path/filepath/path_unix.go index 4e7d0d1b422..d241d78fa78 100644 --- a/libgo/go/path/filepath/path_unix.go +++ b/libgo/go/path/filepath/path_unix.go @@ -8,7 +8,7 @@ package filepath import "strings" -// IsAbs returns true if the path is absolute. +// IsAbs reports whether the path is absolute. func IsAbs(path string) bool { return strings.HasPrefix(path, "/") } @@ -34,3 +34,13 @@ func splitList(path string) []string { func abs(path string) (string, error) { return unixAbs(path) } + +func join(elem []string) string { + // If there's a bug here, fix the logic in ./path_plan9.go too. + for i, e := range elem { + if e != "" { + return Clean(strings.Join(elem[i:], string(Separator))) + } + } + return "" +} |