summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/delete.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/delete.c b/src/delete.c
index ee95e54..6ffe922 100644
--- a/src/delete.c
+++ b/src/delete.c
@@ -194,12 +194,14 @@ delete_nxt:
if(r == -1 && !ignoreerr) {
state = DS_FAILED;
lasterrno = errno;
+ curdir = dr;
while(state == DS_FAILED)
if(input_handle(0))
return 1;
- }
-
- freedir(dr);
+ } else
+ freedir(dr);
+ if(r == -1 && root == dr)
+ return 1;
return 0;
}