settings: remove - if the directory is empty, remove it, too

This commit is contained in:
Jaroslav Kysela 2014-06-20 18:36:11 +02:00
parent 7e2488e9f4
commit eb53362a9f

View file

@ -327,8 +327,10 @@ hts_settings_remove(const char *pathfmt, ...)
if (stat(fullpath, &st) == 0) {
if (S_ISDIR(st.st_mode))
rmtree(fullpath);
else
else {
unlink(fullpath);
while (rmdir(dirname(fullpath)) == 0);
}
}
}