diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2025-07-19 16:59:16 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2025-07-19 18:27:09 -0700 |
| commit | c3da98cf5a8b8a3164db78998bda848100871918 (patch) | |
| tree | 63f6d15eedc64b24ed00266a204fd8b391278709 /lib/std/Build | |
| parent | b956b021878cd7b67f01c30a30fcb085887f24dc (diff) | |
| download | zig-c3da98cf5a8b8a3164db78998bda848100871918.tar.gz zig-c3da98cf5a8b8a3164db78998bda848100871918.zip | |
std.zon: update to new I/O API
Diffstat (limited to 'lib/std/Build')
| -rw-r--r-- | lib/std/Build/Cache/Path.zig | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/std/Build/Cache/Path.zig b/lib/std/Build/Cache/Path.zig index a0a58067fc..efd0f86105 100644 --- a/lib/std/Build/Cache/Path.zig +++ b/lib/std/Build/Cache/Path.zig @@ -161,17 +161,19 @@ pub fn formatEscapeString(path: Path, writer: *std.io.Writer) std.io.Writer.Erro } } +/// Deprecated, use double quoted escape to print paths. pub fn fmtEscapeChar(path: Path) std.fmt.Formatter(Path, formatEscapeChar) { return .{ .data = path }; } +/// Deprecated, use double quoted escape to print paths. pub fn formatEscapeChar(path: Path, writer: *std.io.Writer) std.io.Writer.Error!void { if (path.root_dir.path) |p| { - try std.zig.charEscape(p, writer); - if (path.sub_path.len > 0) try std.zig.charEscape(fs.path.sep_str, writer); + for (p) |byte| try std.zig.charEscape(byte, writer); + if (path.sub_path.len > 0) try writer.writeByte(fs.path.sep); } if (path.sub_path.len > 0) { - try std.zig.charEscape(path.sub_path, writer); + for (path.sub_path) |byte| try std.zig.charEscape(byte, writer); } } |
