diff options
Diffstat (limited to 'eval.c')
-rw-r--r-- | eval.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -243,6 +243,11 @@ bool eval_uid(const struct expr *expr, struct eval_state *state) { bool eval_delete(const struct expr *expr, struct eval_state *state) { struct BFTW *ftwbuf = state->ftwbuf; + // Don't try to delete the current directory + if (strcmp(ftwbuf->path, ".") == 0) { + return true; + } + int flag = 0; if (ftwbuf->typeflag == BFTW_DIR) { flag |= AT_REMOVEDIR; |