From 96ff9c115c401e62c592a0e3d7661e3c3c67483b Mon Sep 17 00:00:00 2001 From: Joachim Wiberg Date: Wed, 18 May 2022 07:25:39 +0200 Subject: [PATCH] Follow-up to 9304024: skip . and .. Signed-off-by: Joachim Wiberg --- src/cond-w.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/cond-w.c b/src/cond-w.c index a4cd018f..f908599e 100644 --- a/src/cond-w.c +++ b/src/cond-w.c @@ -145,12 +145,16 @@ static void cond_delpath(const char *path) return; while ((d = readdir(dir))) { + if (!strcmp(d->d_name, ".") || !strcmp(d->d_name, "..")) + continue; + paste(fn, sizeof(fn), path, d->d_name); if (remove(fn)) _pe("Failed removing condition path, file %s", fn); } closedir(dir); - if (unlink(path)) + + if (unlink(path) && errno != EISDIR) _pe("Failed removing condition path %s", fn); }