diff options
Diffstat (limited to 'src/pkg/os/path.go')
-rw-r--r-- | src/pkg/os/path.go | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/pkg/os/path.go b/src/pkg/os/path.go index 0eb3ee503..7b93036aa 100644 --- a/src/pkg/os/path.go +++ b/src/pkg/os/path.go @@ -24,12 +24,12 @@ func MkdirAll(path string, perm uint32) Error { // Doesn't already exist; make sure parent does. i := len(path) - for i > 0 && path[i-1] == '/' { // Skip trailing slashes. + for i > 0 && IsPathSeparator(path[i-1]) { // Skip trailing path separator. i-- } j := i - for j > 0 && path[j-1] != '/' { // Scan backward over element. + for j > 0 && !IsPathSeparator(path[j-1]) { // Scan backward over element. j-- } @@ -90,11 +90,14 @@ func RemoveAll(path string) Error { for { names, err1 := fd.Readdirnames(100) for _, name := range names { - err1 := RemoveAll(path + "/" + name) + err1 := RemoveAll(path + string(PathSeparator) + name) if err == nil { err = err1 } } + if err1 == EOF { + break + } // If Readdirnames returned an error, use it. if err == nil { err = err1 |