diff options
Diffstat (limited to 'libgo/go/os/path.go')
-rw-r--r-- | libgo/go/os/path.go | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/libgo/go/os/path.go b/libgo/go/os/path.go index 0eb3ee5..a8dfce3 100644 --- a/libgo/go/os/path.go +++ b/libgo/go/os/path.go @@ -4,7 +4,6 @@ package os - // MkdirAll creates a directory named path, // along with any necessary parents, and returns nil, // or else returns an error. @@ -24,12 +23,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 +89,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 |