diff options
author | 2023-04-29 18:58:43 -0700 | |
---|---|---|
committer | 2023-04-29 18:58:43 -0700 | |
commit | e321e1c5f835282b4f65128d1631acb811e79ff1 (patch) | |
tree | 0d3c259b7a14eb6716da39098123d6e1b0761a13 | |
parent | 737822b2ba15679b598deab8fb2db8a970bf5979 (diff) | |
download | bun-e321e1c5f835282b4f65128d1631acb811e79ff1.tar.gz bun-e321e1c5f835282b4f65128d1631acb811e79ff1.tar.zst bun-e321e1c5f835282b4f65128d1631acb811e79ff1.zip |
Fix debug mode crash with trailing slash in import specifier
-rw-r--r-- | src/fs.zig | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/fs.zig b/src/fs.zig index eddd37bca..733bccd24 100644 --- a/src/fs.zig +++ b/src/fs.zig @@ -1191,6 +1191,10 @@ pub const PathName = struct { dir = &([_]u8{}); } + if (base.len > 1 and base[base.len - 1] == '/') { + base = base[0 .. base.len - 1]; + } + return PathName{ .dir = dir, .base = base, |