mirror of
https://github.com/ziglang/zig.git
synced 2026-01-20 22:35:24 +00:00
std.Build.Cache.Path: fix the format method
This function previously wrote a trailing directory separator, but that's not correct if the path refers to a file.
This commit is contained in:
parent
818f9cb5a0
commit
fd4d366009
@ -157,12 +157,17 @@ pub fn format(
|
||||
}
|
||||
if (self.root_dir.path) |p| {
|
||||
try writer.writeAll(p);
|
||||
try writer.writeAll(fs.path.sep_str);
|
||||
if (self.sub_path.len > 0) {
|
||||
try writer.writeAll(fs.path.sep_str);
|
||||
try writer.writeAll(self.sub_path);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (self.sub_path.len > 0) {
|
||||
try writer.writeAll(self.sub_path);
|
||||
try writer.writeAll(fs.path.sep_str);
|
||||
return;
|
||||
}
|
||||
try writer.writeByte('.');
|
||||
}
|
||||
|
||||
pub fn eql(self: Path, other: Path) bool {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user