This commit is contained in:
chloe caruso
2025-01-19 20:47:11 -08:00
parent 92c0b65cb3
commit d0f0302468
4 changed files with 21 additions and 11 deletions

View File

@@ -2179,8 +2179,7 @@ pub fn toWPathMaybeDir(wbuf: []u16, utf8: []const u8, comptime add_trailing_lash
//
// An example of this is GetFileAttributesW(L"C:\\hello/world.txt") being OK
// but GetFileAttributesW(L"\\\\?\\C:\\hello/world.txt") is NOT
if (Environment.isWindows)
bun.path.dangerouslyConvertPathToWindowsInPlace(u16, wbuf[0..result.count]);
bun.path.dangerouslyConvertPathToWindowsInPlace(u16, wbuf[0..result.count]);
if (add_trailing_lash and result.count > 0 and wbuf[result.count - 1] != '\\') {
wbuf[result.count] = '\\';