-+ if (detect_renamed && S_ISREG(fp->mode))
-+ look_for_rename(fp, fname, dirlist->file_pool);
- delete_item(fname, fp->mode, flags & ~DEL_TERSE);
- }
- flist_free(dirlist);
-@@ -197,7 +314,8 @@ static int delete_item(char *fname, int
-
- pop_local_filters(save_filters);
-
-- if (max_delete && ++deletion_count > max_delete)
-+ if (flags & DEL_NO_DELETIONS
-+ || (max_delete && ++deletion_count > max_delete))
- return 0;
-
- if (do_rmdir(fname) == 0) {
-@@ -217,15 +335,19 @@ static int delete_item(char *fname, int
++ if (detect_renamed) {
++ if (S_ISDIR(fp->mode) && flags & DEL_NO_DELETIONS) {
++ delete_dir_contents(fname, flags);
++ continue;
++ }
++ if (S_ISREG(fp->mode))
++ look_for_rename(fp, fname, dirlist->file_pool);
++ if (flags & DEL_NO_DELETIONS)
++ continue;
++ }
+ result = delete_item(fname, fp->mode, NULL, flags);
+ if (result != DR_SUCCESS && ret == DR_SUCCESS)
+ ret = result == DR_PINNED ? result : DR_NOT_EMPTY;
+@@ -239,15 +362,19 @@ static enum delret delete_dir_contents(c