aboutsummaryrefslogtreecommitdiff
path: root/src/resolver/resolve_path.zig
diff options
context:
space:
mode:
authorGravatar Zilin Zhu <zilinzhu@tencent.com> 2022-08-04 12:14:08 +0800
committerGravatar GitHub <noreply@github.com> 2022-08-03 21:14:08 -0700
commit36d5d764d8d311d47ce0f86a1ed5501f90cc2310 (patch)
tree093f82613f6b7a583ffe8a6b61b9b82d005b38b8 /src/resolver/resolve_path.zig
parentb310d7c40df5bc574f2879e5cf4dca973df47d2d (diff)
downloadbun-36d5d764d8d311d47ce0f86a1ed5501f90cc2310.tar.gz
bun-36d5d764d8d311d47ce0f86a1ed5501f90cc2310.tar.zst
bun-36d5d764d8d311d47ce0f86a1ed5501f90cc2310.zip
fix path.normalize on ... (#966)
Diffstat (limited to 'src/resolver/resolve_path.zig')
-rw-r--r--src/resolver/resolve_path.zig2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/resolver/resolve_path.zig b/src/resolver/resolve_path.zig
index 10cea0c37..40e0a7788 100644
--- a/src/resolver/resolve_path.zig
+++ b/src/resolver/resolve_path.zig
@@ -372,7 +372,7 @@ pub fn normalizeStringGeneric(path: []const u8, buf: []u8, comptime allow_above_
continue;
}
- if (@"is ../"(path[r..]) or @"is .."(path[r..])) {
+ if (@"is .."(path[r..]) and (r + 2 == n or isSeparator(path[r + 2]))) {
r += 2;
// .. element: remove to last separator
if (buf_i > dotdot) {