diff options
author | portix <portix@gmx.net> | 2012-01-07 14:29:36 +0100 |
---|---|---|
committer | portix <portix@gmx.net> | 2012-01-07 14:29:36 +0100 |
commit | 0fe56ec1d948ed6280973db39345aef3e7fe604f (patch) | |
tree | 536894ee1a98b6489bf30f868e4e2f937d679d0b /src/util.c | |
parent | cd970cb9b5163fab1aa3977f6d0ca9cce3a6387f (diff) | |
download | dwb-0fe56ec1d948ed6280973db39345aef3e7fe604f.zip |
Only remove content of the cachdir when cleaning up, not the directory itself.
Diffstat (limited to 'src/util.c')
-rw-r--r-- | src/util.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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); |