aboutsummaryrefslogtreecommitdiff
path: root/lib/std/Build
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2025-07-20 09:48:25 +0200
committerGitHub <noreply@github.com>2025-07-20 09:48:25 +0200
commite43617e686f62af55d6663b695ec725e21bff210 (patch)
tree36281b6b7607d8d7744749d4924acf6730b0ed2f /lib/std/Build
parentc58cce799932a5b9a735ac359794ec8bcde61633 (diff)
parent0fb7a0a94bf6f9e329008d8b5b819a8d1d7124b0 (diff)
downloadzig-e43617e686f62af55d6663b695ec725e21bff210.tar.gz
zig-e43617e686f62af55d6663b695ec725e21bff210.zip
Merge pull request #24505 from ziglang/json
update std.json and std.zon to new I/O API
Diffstat (limited to 'lib/std/Build')
-rw-r--r--lib/std/Build/Cache/Path.zig8
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);
}
}