| ... | @@ -638,10 +638,9 @@ pub async fn readFile(loop: *Loop, file_path: []const u8, max_size: usize) ![]u8 | ... | @@ -638,10 +638,9 @@ pub async fn readFile(loop: *Loop, file_path: []const u8, max_size: usize) ![]u8 |
| 638 | var close_op = try CloseOperation.start(loop); | 638 | var close_op = try CloseOperation.start(loop); |
| 639 | defer close_op.finish(); | 639 | defer close_op.finish(); |
| 640 | | 640 | |
| 641 | const path_with_null = try std.cstr.addNullByte(loop.allocator, file_path); | 641 | const file_path_c = try os.toPosixPath(file_path); |
| 642 | defer loop.allocator.free(path_with_null); | | |
| 643 | | 642 | |
| 644 | const fd = try await (async openRead(loop, path_with_null[0..file_path.len]) catch unreachable); | 643 | const fd = try await (async openRead(loop, file_path_c[0..file_path.len]) catch unreachable); |
| 645 | close_op.setHandle(fd); | 644 | close_op.setHandle(fd); |
| 646 | | 645 | |
| 647 | var list = std.ArrayList(u8).init(loop.allocator); | 646 | var list = std.ArrayList(u8).init(loop.allocator); |