| author | |
| committer | |
| log | 4f8a44cd0f636f3ffe008b2cedafa1e51a4a3796 |
| tree | e395558fb0348b842e20de3a059da10673bf3bbd |
| parent | 44e2dbe117fe79b99a970990878a061bdd26ff55 |
2 files changed, 4 insertions(+), 3 deletions(-)
src/Builtin.zig+2-1| ... | @@ -279,7 +279,8 @@ pub fn populateFile(comp: *Compilation, mod: *Module, file: *File) !void { | ... | @@ -279,7 +279,8 @@ pub fn populateFile(comp: *Compilation, mod: *Module, file: *File) !void { |
| 279 | } | 279 | } |
| 280 | 280 | ||
| 281 | fn writeFile(file: *File, mod: *Module) !void { | 281 | fn writeFile(file: *File, mod: *Module) !void { |
| 282 | var af = try mod.root.atomicFile(mod.root_src_path, .{ .make_path = true }); | 282 | var buf: [std.fs.MAX_PATH_BYTES]u8 = undefined; |
| 283 | var af = try mod.root.atomicFile(mod.root_src_path, .{ .make_path = true }, &buf); | ||
| 283 | defer af.deinit(); | 284 | defer af.deinit(); |
| 284 | try af.file.writeAll(file.source); | 285 | try af.file.writeAll(file.source); |
| 285 | try af.finish(); | 286 | try af.finish(); |
src/Package.zig+2-2| ... | @@ -88,10 +88,10 @@ pub const Path = struct { | ... | @@ -88,10 +88,10 @@ pub const Path = struct { |
| 88 | p: Path, | 88 | p: Path, |
| 89 | sub_path: []const u8, | 89 | sub_path: []const u8, |
| 90 | options: fs.Dir.AtomicFileOptions, | 90 | options: fs.Dir.AtomicFileOptions, |
| 91 | buf: *[fs.MAX_PATH_BYTES]u8, | ||
| 91 | ) !fs.AtomicFile { | 92 | ) !fs.AtomicFile { |
| 92 | var buf: [fs.MAX_PATH_BYTES]u8 = undefined; | ||
| 93 | const joined_path = if (p.sub_path.len == 0) sub_path else p: { | 93 | const joined_path = if (p.sub_path.len == 0) sub_path else p: { |
| 94 | break :p std.fmt.bufPrint(&buf, "{s}" ++ fs.path.sep_str ++ "{s}", .{ | 94 | break :p std.fmt.bufPrint(buf, "{s}" ++ fs.path.sep_str ++ "{s}", .{ |
| 95 | p.sub_path, sub_path, | 95 | p.sub_path, sub_path, |
| 96 | }) catch return error.NameTooLong; | 96 | }) catch return error.NameTooLong; |
| 97 | }; | 97 | }; |