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

From cb0c7c9680d08c75850a51e4e70f520cfd13a0ff Mon Sep 17 00:00:00 2001
From: Petar Popovic <[EMAIL REDACTED]>
Date: Sun, 27 Oct 2024 23:35:54 +0100
Subject: [PATCH] SDL_CreateDirectory(): directory tree creation for absolute
 paths for non-Windows platforms

---
 src/filesystem/SDL_filesystem.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/filesystem/SDL_filesystem.c b/src/filesystem/SDL_filesystem.c
index a29ae38fdda20..d13b6ea8d93b2 100644
--- a/src/filesystem/SDL_filesystem.c
+++ b/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) {