Merge branch 'jc/safe-c-l-d'
* jc/safe-c-l-d: safe_create_leading_directories(): make it about "leading" directories
This commit is contained in:
commit
58245a5e40
@ -99,7 +99,11 @@ int safe_create_leading_directories(char *path)
|
||||
pos = strchr(pos, '/');
|
||||
if (!pos)
|
||||
break;
|
||||
*pos = 0;
|
||||
while (*++pos == '/')
|
||||
;
|
||||
if (!*pos)
|
||||
break;
|
||||
*--pos = '\0';
|
||||
if (!stat(path, &st)) {
|
||||
/* path exists */
|
||||
if (!S_ISDIR(st.st_mode)) {
|
||||
|
Loading…
Reference in New Issue
Block a user