From 0fe56ec1d948ed6280973db39345aef3e7fe604f Mon Sep 17 00:00:00 2001 From: portix Date: Sat, 7 Jan 2012 14:29:36 +0100 Subject: Only remove content of the cachdir when cleaning up, not the directory itself. --- src/util.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/util.c') diff --git a/src/util.c b/src/util.c index fbd4a0c7..575acd9b 100644 --- a/src/util.c +++ b/src/util.c @@ -303,7 +303,7 @@ util_get_directory_content(GString **buffer, const char *dirname, const char *ex }/*}}}*/ void -util_rmdir(const char *path, gboolean recursive) { +util_rmdir(const char *path, gboolean only_content, gboolean recursive) { GDir *dir = g_dir_open(path, 0, NULL); if (dir == NULL) return; @@ -315,12 +315,12 @@ util_rmdir(const char *path, gboolean recursive) { unlink(fullpath); } else if (recursive) { - util_rmdir(fullpath, true); + util_rmdir(fullpath, false, true); rmdir(fullpath); } g_free(fullpath); } - if (filename == NULL) { + if (filename == NULL && !only_content) { rmdir(path); } g_dir_close(dir); -- cgit v1.2.3