url: fix regression with unified diff lines

Bare relative paths don't need space-continuation semantics.

Fixes #10773
This commit is contained in:
Ben Kircher
2026-02-19 21:01:24 +01:00
parent c5488afc75
commit f66064b0b0

View File

@@ -110,7 +110,6 @@ const bare_relative_path_branch =
dotted_path_lookahead ++
bare_relative_path_prefix ++
path_chars ++ "+" ++
dotted_path_space_segments ++
no_trailing_colon ++
trailing_spaces_at_eol;
@@ -363,6 +362,11 @@ test "url regex" {
.input = "/tmp/test folder/file.txt",
.expect = "/tmp/test",
},
// unified diff lines
.{
.input = "diff --git a/src/font/shaper/harfbuzz.zig b/src/font/shaper/harfbuzz.zig",
.expect = "a/src/font/shaper/harfbuzz.zig",
},
// Two space-separated absolute paths should match only the first
.{
.input = "/tmp/foo /tmp/bar",