| ... | ... | @@ -6090,12 +6090,19 @@ fn dirRealPathFileWindows(userdata: ?*anyopaque, dir: Dir, sub_path: []const u8, |
| 6090 | 6090 | } |
| 6091 | 6091 | }; |
| 6092 | 6092 | defer windows.CloseHandle(h_file); |
| 6093 | | return realPathWindows(h_file, out_buffer); |
| 6093 | |
| 6094 | // We can re-use the path buffer for the WTF-16 representation since |
| 6095 | // we don't need the prefixed path anymore |
| 6096 | return realPathWindowsBuf(h_file, out_buffer, &path_name_w.data); |
| 6094 | 6097 | } |
| 6095 | 6098 | |
| 6096 | 6099 | fn realPathWindows(h_file: windows.HANDLE, out_buffer: []u8) File.RealPathError!usize { |
| 6097 | 6100 | var wide_buf: [windows.PATH_MAX_WIDE]u16 = undefined; |
| 6098 | | const wide_slice = try GetFinalPathNameByHandle(h_file, .{}, &wide_buf); |
| 6101 | return realPathWindowsBuf(h_file, out_buffer, &wide_buf); |
| 6102 | } |
| 6103 | |
| 6104 | fn realPathWindowsBuf(h_file: windows.HANDLE, out_buffer: []u8, wtf16_buffer: []u16) File.RealPathError!usize { |
| 6105 | const wide_slice = try GetFinalPathNameByHandle(h_file, .{}, wtf16_buffer); |
| 6099 | 6106 | |
| 6100 | 6107 | const len = std.unicode.calcWtf8Len(wide_slice); |
| 6101 | 6108 | if (len > out_buffer.len) |