aboutsummaryrefslogtreecommitdiff
path: root/src/resolver/resolve_path.zig
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <jarred@jarredsumner.com> 2021-07-13 10:32:57 -0700
committerGravatar Jarred Sumner <jarred@jarredsumner.com> 2021-07-13 10:32:57 -0700
commitfea9faaf4cd110591e9e6f07cd4d17cbc0ea5918 (patch)
treeb59ec68d139ebcb339cd7bd6d1d15eb71a423b4f /src/resolver/resolve_path.zig
parentb1b459435f375bf5eef7c6aeb7285ac6c2719b62 (diff)
downloadbun-fea9faaf4cd110591e9e6f07cd4d17cbc0ea5918.tar.gz
bun-fea9faaf4cd110591e9e6f07cd4d17cbc0ea5918.tar.zst
bun-fea9faaf4cd110591e9e6f07cd4d17cbc0ea5918.zip
alright
Former-commit-id: ab73c7b323c222e5d1172c07036653ca98aa8e6b
Diffstat (limited to 'src/resolver/resolve_path.zig')
-rw-r--r--src/resolver/resolve_path.zig4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/resolver/resolve_path.zig b/src/resolver/resolve_path.zig
index 1bba7d12c..a2ed2773d 100644
--- a/src/resolver/resolve_path.zig
+++ b/src/resolver/resolve_path.zig
@@ -682,7 +682,7 @@ pub fn joinStringBuf(buf: []u8, _parts: anytype, comptime _platform: Platform) [
}
// Preserve leading separator
- if (_parts[0][0] == _platform.separator()) {
+ if (_parts[0].len > 0 and _parts[0][0] == _platform.separator()) {
const out = switch (platform) {
.loose => normalizeStringLooseBuf(parser_join_input_buffer[0..written], buf[1..], false, false),
.windows => normalizeStringWindows(parser_join_input_buffer[0..written], buf[1..], false, false),
@@ -769,7 +769,7 @@ pub fn joinAbsStringBuf(_cwd: []const u8, buf: []u8, _parts: anytype, comptime _
const offset = out;
out += normalized_part.len;
- std.debug.assert(out < buf.len);
+ std.debug.assert(out <= buf.len);
std.mem.copy(u8, buf[offset..out], normalized_part);
}