Follow-up to 9304024: skip . and ..

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg committed 2022-05-18 07:25:39 +02:00
1 parent 83aa6abb1c
commit 96ff9c115c
1 file changed
+5 -1
+5 -1
View File
@@ -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);
}