diff options
author | 2023-04-12 19:25:39 -0700 | |
---|---|---|
committer | 2023-04-12 19:25:39 -0700 | |
commit | a03ee1826252517b1c802f7afb845378368b4e0b (patch) | |
tree | cadddd06e4682d479902bb51d7bbc8c51a9c3fde /src | |
parent | 108c54134c12a937b8c55abae79b159b97fd2093 (diff) | |
download | bun-a03ee1826252517b1c802f7afb845378368b4e0b.tar.gz bun-a03ee1826252517b1c802f7afb845378368b4e0b.tar.zst bun-a03ee1826252517b1c802f7afb845378368b4e0b.zip |
fix bundling many entry points (#2640)
* fix going out of bounds when length is over 8
* remove
Diffstat (limited to 'src')
-rw-r--r-- | src/resolver/resolve_path.zig | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/resolver/resolve_path.zig b/src/resolver/resolve_path.zig index 50d41eab0..f3c43b554 100644 --- a/src/resolver/resolve_path.zig +++ b/src/resolver/resolve_path.zig @@ -128,12 +128,13 @@ pub fn longestCommonPathGeneric(input: []const []const u8, comptime separator: u }, else => { var string_index: usize = 1; - while (index < min_length) : (index += 1) { - while (string_index < input.len) : (string_index += 1) { - if (input[0][string_index] != input[index][string_index]) { + while (string_index < input.len) : (string_index += 1) { + while (index < min_length) : (index += 1) { + if (input[0][index] != input[string_index][index]) { break; } } + if (index == min_length) index -= 1; if (@call(.always_inline, isPathSeparator, .{input[0][index]})) { last_common_separator = index; } |