summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2013-07-04 15:45:54 +0200
committerGravatar Nikias Bassen2013-07-04 15:45:54 +0200
commit8cc32db613b5cdae0820b026d7a85e88c46c81a6 (patch)
tree5670c16172a36ffd7f0a3a20e530adf7f28c2c49 /src
parent0747f8e0c20fed69a53d4782530bc848e4e13b08 (diff)
downloadidevicerestore-8cc32db613b5cdae0820b026d7a85e88c46c81a6.tar.gz
idevicerestore-8cc32db613b5cdae0820b026d7a85e88c46c81a6.tar.bz2
common: do not recurse mkdir_with_parents if dirname(dir) == dir
Diffstat (limited to 'src')
-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;