@@ -5675,10 +5675,9 @@ pub const RealPathError = error{
5675
5675
/// Calling this function is usually a bug.
5676
5676
pub fn realpath (pathname : []const u8 , out_buffer : * [max_path_bytes ]u8 ) RealPathError ! []u8 {
5677
5677
if (native_os == .windows ) {
5678
- const pathname_w = try windows .sliceToPrefixedFileW (null , pathname );
5678
+ var pathname_w = try windows .sliceToPrefixedFileW (null , pathname );
5679
5679
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 );
5682
5681
5683
5682
const end_index = std .unicode .wtf16LeToWtf8 (out_buffer , wide_slice );
5684
5683
return out_buffer [0.. end_index ];
@@ -5694,10 +5693,9 @@ pub fn realpath(pathname: []const u8, out_buffer: *[max_path_bytes]u8) RealPathE
5694
5693
/// Calling this function is usually a bug.
5695
5694
pub fn realpathZ (pathname : [* :0 ]const u8 , out_buffer : * [max_path_bytes ]u8 ) RealPathError ! []u8 {
5696
5695
if (native_os == .windows ) {
5697
- const pathname_w = try windows .cStrToPrefixedFileW (null , pathname );
5696
+ var pathname_w = try windows .cStrToPrefixedFileW (null , pathname );
5698
5697
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 );
5701
5699
5702
5700
const end_index = std .unicode .wtf16LeToWtf8 (out_buffer , wide_slice );
5703
5701
return out_buffer [0.. end_index ];
0 commit comments