| ... | ... | @@ -178,22 +178,15 @@ pub fn formatEscapeChar(path: Path, writer: *Io.Writer) Io.Writer.Error!void { |
| 178 | 178 | |
| 179 | 179 | pub fn format(self: Path, writer: *Io.Writer) Io.Writer.Error!void { |
| 180 | 180 | if (Io.Dir.path.isAbsolute(self.sub_path)) { |
| 181 | | try writer.writeAll(self.sub_path); |
| 182 | | return; |
| 181 | return writer.writeAll(self.sub_path); |
| 182 | } else if (self.root_dir.path) |p| { |
| 183 | var bufs: [3][]const u8 = .{ p, Io.Dir.path.sep_str, self.sub_path }; |
| 184 | return writer.writeVecAll(bufs[0..if (self.sub_path.len > 0) 3 else 1]); |
| 185 | } else if (self.sub_path.len > 0) { |
| 186 | return writer.writeAll(self.sub_path); |
| 187 | } else { |
| 188 | return writer.writeByte('.'); |
| 183 | 189 | } |
| 184 | | if (self.root_dir.path) |p| { |
| 185 | | try writer.writeAll(p); |
| 186 | | if (self.sub_path.len > 0) { |
| 187 | | try writer.writeAll(Io.Dir.path.sep_str); |
| 188 | | try writer.writeAll(self.sub_path); |
| 189 | | } |
| 190 | | return; |
| 191 | | } |
| 192 | | if (self.sub_path.len > 0) { |
| 193 | | try writer.writeAll(self.sub_path); |
| 194 | | return; |
| 195 | | } |
| 196 | | try writer.writeByte('.'); |
| 197 | 190 | } |
| 198 | 191 | |
| 199 | 192 | pub fn eql(self: Path, other: Path) bool { |