From: Guus Sliepen Date: Sun, 6 Dec 2020 15:17:58 +0000 (+0100) Subject: Fix deleting configuration directories with hidden files. X-Git-Url: http://git.meshlink.io/?p=meshlink;a=commitdiff_plain;h=74e7a207fa1504872f43e00837106d3e40f6a547 Fix deleting configuration directories with hidden files. We incorrectly skipped files starting with a dot when deleting directories. This is a problem on macOS, which might add .DS_Store files. --- diff --git a/src/conf.c b/src/conf.c index 1ed5ff61..dd076170 100644 --- a/src/conf.c +++ b/src/conf.c @@ -79,7 +79,9 @@ static bool deltree(const char *dirname) { while((ent = readdir(d))) { if(ent->d_name[0] == '.') { - continue; + if(!ent->d_name[1] || (ent->d_name[1] == '.' && !ent->d_name[2])) { + continue; + } } char filename[PATH_MAX];