settings: remove - if the directory is empty, remove it, too
This commit is contained in:
parent
7e2488e9f4
commit
eb53362a9f
1 changed files with 3 additions and 1 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue