@@ -5675,10 +5675,9 @@ pub const RealPathError = error{
56755675/// Calling this function is usually a bug.
56765676pub fn realpath (pathname : []const u8 , out_buffer : * [max_path_bytes ]u8 ) RealPathError ! []u8 {
56775677 if (native_os == .windows ) {
5678- const pathname_w = try windows .sliceToPrefixedFileW (null , pathname );
5678+ var pathname_w = try windows .sliceToPrefixedFileW (null , pathname );
56795679
5680- var wide_buf : [windows .PATH_MAX_WIDE ]u16 = undefined ;
5681- const wide_slice = try realpathW (pathname_w .span (), & wide_buf );
5680+ const wide_slice = try realpathW (pathname_w .span (), & pathname_w .data );
56825681
56835682 const end_index = std .unicode .wtf16LeToWtf8 (out_buffer , wide_slice );
56845683 return out_buffer [0.. end_index ];
@@ -5694,10 +5693,9 @@ pub fn realpath(pathname: []const u8, out_buffer: *[max_path_bytes]u8) RealPathE
56945693/// Calling this function is usually a bug.
56955694pub fn realpathZ (pathname : [* :0 ]const u8 , out_buffer : * [max_path_bytes ]u8 ) RealPathError ! []u8 {
56965695 if (native_os == .windows ) {
5697- const pathname_w = try windows .cStrToPrefixedFileW (null , pathname );
5696+ var pathname_w = try windows .cStrToPrefixedFileW (null , pathname );
56985697
5699- var wide_buf : [windows .PATH_MAX_WIDE ]u16 = undefined ;
5700- const wide_slice = try realpathW (pathname_w .span (), & wide_buf );
5698+ const wide_slice = try realpathW (pathname_w .span (), & pathname_w .data );
57015699
57025700 const end_index = std .unicode .wtf16LeToWtf8 (out_buffer , wide_slice );
57035701 return out_buffer [0.. end_index ];
0 commit comments