From eb53362a9f8553d636284ae0867b7cfd9e26d0af Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Fri, 20 Jun 2014 18:36:11 +0200 Subject: [PATCH] settings: remove - if the directory is empty, remove it, too --- src/settings.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/settings.c b/src/settings.c index fa0438c8..37dfb25a 100644 --- a/src/settings.c +++ b/src/settings.c @@ -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); + } } }