os/os2: fix mkdir_all on posix with abs path

This commit is contained in:
Laytan Laats
2024-10-07 22:11:16 +02:00
parent c50eaa0b77
commit 4b8462aa70

View File

@@ -40,7 +40,7 @@ _mkdir_all :: proc(path: string, perm: int) -> Error {
internal_mkdir_all :: proc(path: string, perm: int) -> Error {
dir, file := filepath.split(path)
if file != path {
if file != path && dir != "/" {
if len(dir) > 1 && dir[len(dir) - 1] == '/' {
dir = dir[:len(dir) - 1]
}