diff options
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; } |