mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-05 07:08:48 +00:00
Fix os.walk for UNC paths.
This commit is contained in:
@@ -115,12 +115,16 @@ cleanpath_strip_prefix :: proc(buf: []u16) -> []u16 {
|
|||||||
}
|
}
|
||||||
buf = buf[:N]
|
buf = buf[:N]
|
||||||
|
|
||||||
if len(buf) >= 4 {
|
if len(buf) >= 4 && buf[0] == '\\' && buf[1] == '\\' && buf[2] == '?' && buf[3] == '\\' {
|
||||||
if buf[0] == '\\' &&
|
buf = buf[4:]
|
||||||
buf[1] == '\\' &&
|
|
||||||
buf[2] == '?' &&
|
/*
|
||||||
buf[3] == '\\' {
|
NOTE(Jeroen): Properly handle UNC paths.
|
||||||
buf = buf[4:]
|
We need to turn `\\?\UNC\synology.local` into `\\synology.local`.
|
||||||
|
*/
|
||||||
|
if len(buf) >= 3 && buf[0] == 'U' && buf[1] == 'N' && buf[2] == 'C' {
|
||||||
|
buf = buf[2:]
|
||||||
|
buf[0] = '\\'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return buf
|
return buf
|
||||||
|
|||||||
Reference in New Issue
Block a user