summaryrefslogtreecommitdiff
path: root/dir.c
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2010-03-07 14:53:50 -0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2010-03-07 14:53:50 -0800
commitcb16bcc36965f28845e4fae15c36280a2506f1be (patch)
treea1acd0c9c1b89d30749f4414d727064f1c416fd5 /dir.c
parentMerge branch 'rs/optim-text-wrap' into maint-1.6.6 (diff)
parentrm: fix bug in recursive subdirectory removal (diff)
downloadtgif-cb16bcc36965f28845e4fae15c36280a2506f1be.tar.xz
Merge branch 'jk/maint-rmdir-fix' into maint-1.6.6
* jk/maint-rmdir-fix: rm: fix bug in recursive subdirectory removal
Diffstat (limited to 'dir.c')
-rw-r--r--dir.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/dir.c b/dir.c
index d0999ba055..5d0a3084db 100644
--- a/dir.c
+++ b/dir.c
@@ -933,7 +933,7 @@ int remove_path(const char *name)
slash = dirs + (slash - name);
do {
*slash = '\0';
- } while (rmdir(dirs) && (slash = strrchr(dirs, '/')));
+ } while (rmdir(dirs) == 0 && (slash = strrchr(dirs, '/')));
free(dirs);
}
return 0;