From 1f2d978396df59a7011efeff93edd3bba0c8bfb4 Mon Sep 17 00:00:00 2001 From: imp0s5ible Date: Sun, 29 Mar 2026 21:11:22 +0200 Subject: [PATCH] Fix #6495 - Handle starting separator during name comparison During the loop comparing file/directory names, the starting character in both will be a path separator in most cases. Since a naive string equality will regard forward slashes and backslashes as different, we must specially handle the first character and exclude it from the equality comparison if necessary. --- core/os/path_windows.odin | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/os/path_windows.odin b/core/os/path_windows.odin index b471ab0b0..98e26f929 100644 --- a/core/os/path_windows.odin +++ b/core/os/path_windows.odin @@ -349,6 +349,9 @@ _get_common_path_len :: proc(base, target: string) -> int { end := min(len(base), len(target)) for j in 0..=end { if j == end || _is_path_separator(base[j]) { + if _is_path_separator(base[i]) && _is_path_separator(target[i]) { + i += 1 + } if strings.equal_fold(base[i:j], target[i:j]) { i = j } else {