diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2018-08-23 20:16:13 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-08-23 20:16:13 -0400 |
| commit | 6c064cfd885ed2bc243dc32eb84703dcb60bd68d (patch) | |
| tree | 8e5aa3e17bb8b90a2735aeeaa1d52f0bf82e223b | |
| parent | 327482c3a41a30d5ea63eedd3bfb13553c8c2d00 (diff) | |
| parent | 2f7f7d815d0c9c4e620c7a529837b5ef42d724f1 (diff) | |
| download | zig-6c064cfd885ed2bc243dc32eb84703dcb60bd68d.tar.gz zig-6c064cfd885ed2bc243dc32eb84703dcb60bd68d.zip | |
Merge pull request #1405 from shawnl/path-max
missing PATH_MAX change
| -rw-r--r-- | std/event/fs.zig | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/std/event/fs.zig b/std/event/fs.zig index ac99f13c9b..e6815c7755 100644 --- a/std/event/fs.zig +++ b/std/event/fs.zig @@ -638,10 +638,9 @@ pub async fn readFile(loop: *Loop, file_path: []const u8, max_size: usize) ![]u8 var close_op = try CloseOperation.start(loop); defer close_op.finish(); - const path_with_null = try std.cstr.addNullByte(loop.allocator, file_path); - defer loop.allocator.free(path_with_null); + const file_path_c = try os.toPosixPath(file_path); - const fd = try await (async openRead(loop, path_with_null[0..file_path.len]) catch unreachable); + const fd = try await (async openRead(loop, file_path_c[0..file_path.len]) catch unreachable); close_op.setHandle(fd); var list = std.ArrayList(u8).init(loop.allocator); |
