authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2018-08-23 20:16:13-04:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2018-08-23 20:16:13-04:00
log6c064cfd885ed2bc243dc32eb84703dcb60bd68d
tree8e5aa3e17bb8b90a2735aeeaa1d52f0bf82e223b
parent327482c3a41a30d5ea63eedd3bfb13553c8c2d00
parent2f7f7d815d0c9c4e620c7a529837b5ef42d724f1
signaturebadge-question-mark Signed by PGP key 4AEE18F83AFDEB23

Merge pull request #1405 from shawnl/path-max

missing PATH_MAX change

1 files changed, 2 insertions(+), 3 deletions(-)

std/event/fs.zig+2-3
...@@ -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();
640640
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);
643642
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);
646645
647 var list = std.ArrayList(u8).init(loop.allocator);646 var list = std.ArrayList(u8).init(loop.allocator);