summaryrefslogtreecommitdiff
path: root/utils/container.c
diff options
context:
space:
mode:
Diffstat (limited to 'utils/container.c')
-rw-r--r--utils/container.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/utils/container.c b/utils/container.c
index 605237abe..06d5b9c77 100644
--- a/utils/container.c
+++ b/utils/container.c
@@ -457,13 +457,20 @@ char *container_extract_theme(const char *themefile, const char *dirbasename)
strcpy(dirname, dirbasename);
strcat(dirname, themename);
if (stat(dirname, &statbuf) != -1) {
+ /* directory exists */
+ warn_user("DirectoryError", dirname);
+ container_close(cctx);
+ free(dirname);
+ free(themename);
+ return NULL;
+ }
+ if (mkdir(dirname, S_IRWXU) != 0) {
warn_user("DirectoryError", dirname);
container_close(cctx);
free(dirname);
free(themename);
return NULL;
}
- mkdir(dirname, S_IRWXU);
for (e = container_iterate(cctx, &state), i = 0; i < cctx->entries;
e = container_iterate(cctx, &state), i++) {