Pārlūkot izejas kodu

SDL_CreateDirectory(): directory tree creation for absolute paths for non-Windows platforms

Petar Popovic 11 mēneši atpakaļ
vecāks
revīzija
cb0c7c9680
1 mainītis faili ar 3 papildinājumiem un 0 dzēšanām
  1. 3 0
      src/filesystem/SDL_filesystem.c

+ 3 - 0
src/filesystem/SDL_filesystem.c

@@ -89,6 +89,9 @@ bool SDL_CreateDirectory(const char *path)
                 }
                 #else
                 const bool issep = (ch == '/');
+                if (issep && ((ptr - parents) == 0)) {
+                    continue; // it's just the root directory, skip it.
+                }
                 #endif
 
                 if (issep) {