From 23d22c457aaadecd995c9149d03e216eeb7071cb Mon Sep 17 00:00:00 2001 From: Ben Kircher Date: Mon, 9 Feb 2026 10:50:31 +0100 Subject: [PATCH] url: fix `,` handling for spaced paths Update path_space_segments patterns to consistently handle comma-delimiters. --- src/config/url.zig | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/config/url.zig b/src/config/url.zig index cb5e765e3..5797d4a56 100644 --- a/src/config/url.zig +++ b/src/config/url.zig @@ -61,11 +61,11 @@ const non_dotted_path_lookahead = ; const dotted_path_space_segments = - \\(?: [\w\-.~:\/?#@!$&*+,;=%]*[\/.])* + \\(?: [\w\-.~:\/?#@!$&*+;=%]*[\/.])* ; const any_path_space_segments = - \\(?: [\w\-.~:\/?#@!$&*+,;=%]+)* + \\(?: [\w\-.~:\/?#@!$&*+;=%]+)* ; // Branch 1: URLs with explicit schemes (http, mailto, ftp, etc.). @@ -434,6 +434,15 @@ test "url regex" { .input = "2024/report.txt", .expect = "2024/report.txt", }, + // comma should stop matching in spaced path segments + .{ + .input = "./foo bar,baz", + .expect = "./foo bar", + }, + .{ + .input = "/tmp/foo bar,baz", + .expect = "/tmp/foo bar", + }, }; for (cases) |case| {