| … | … | @@ -84,22 +84,23 @@ static bool is_sep(int c) |
| 84 | 84 | */ |
| 85 | 85 | static bool make_dirpath(const char *path) |
| 86 | 86 | { |
| 87 | | char *dir = strdup(path); |
| 88 | 87 | struct stat sb; |
| 89 | 88 | |
| 90 | 89 | #if defined(_WIN32) || defined(__CYGWIN__) |
| 91 | 90 | // Skip Windows UNC path \\X |
| 92 | | if (is_sep(dir[0]) && is_sep(dir[1])) |
| 91 | if (is_sep(path[0]) && is_sep(path[1])) |
| 93 | 92 | { |
| 94 | 93 | const char *p; |
| 95 | 94 | |
| 96 | 95 | // Start from the root or network share |
| 97 | | for (p = dir + 2; *p != '\0'; p++) |
| 96 | for (p = path + 2; *p != '\0'; p++) |
| 98 | 97 | if (is_sep(*p)) break; |
| 99 | 98 | if (*p == '\0') return true; // No further subdirectories |
| 100 | 99 | } |
| 101 | 100 | #endif |
| 102 | 101 | |
| 102 | char *dir = strdup(path); |
| 103 | |
| 103 | 104 | for (char *p = dir+1; '\0' != *p; p++) |
| 104 | 105 | { |
| 105 | 106 | char sep = *p; |