Fix bug with invalid character at the end of comment path

This commit is contained in:
Jarred Sumner
2023-04-20 05:24:29 -07:00
parent d78ecc76c8
commit 3a68ca775f

View File

@@ -1298,7 +1298,7 @@ pub const Path = struct {
var buf = try allocator.alloc(u8, this.text.len + this.pretty.len + 2);
bun.copy(u8, buf, this.text);
buf.ptr[this.text.len] = 0;
var new_pretty = buf[this.text.len + 1 ..];
var new_pretty = buf[this.text.len + 1 ..][0..this.pretty.len];
bun.copy(u8, buf[this.text.len + 1 ..], this.pretty);
var new_path = Fs.Path.init(buf[0..this.text.len]);
buf.ptr[buf.len - 1] = 0;