From 196cf9f617ca17acec75eafbcd9e5e7989752dcb Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Sun, 13 Nov 2016 21:30:48 -0500 Subject: Don't try to -delete the current directory. --- eval.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'eval.c') diff --git a/eval.c b/eval.c index 34343d4..1e88a93 100644 --- a/eval.c +++ b/eval.c @@ -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; -- cgit v1.2.3