summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/common.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/common.c b/src/common.c
index f7ad7e6..b95b5e3 100644
--- a/src/common.c
+++ b/src/common.c
@@ -236,7 +236,7 @@ int mkdir_with_parents(const char *dir, int mode)
int res;
char *parent = strdup(dir);
parent = dirname(parent);
- if (parent && (strcmp(parent, ".") != 0)) {
+ if (parent && (strcmp(parent, ".") != 0) && (strcmp(parent, dir) != 0)) {
res = mkdir_with_parents(parent, mode);
} else {
res = -1;