From 36d5d764d8d311d47ce0f86a1ed5501f90cc2310 Mon Sep 17 00:00:00 2001 From: Zilin Zhu Date: Thu, 4 Aug 2022 12:14:08 +0800 Subject: fix path.normalize on ... (#966) --- src/resolver/resolve_path.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') 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) { -- cgit v1.2.3