Skip to content

Commit cc837c9

Browse files
committed
forbid usage of capture groups in list patterns with programs
1 parent eb8ccae commit cc837c9

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

jaro

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,8 +156,8 @@
156156
(set! str (substring-replace str "%F" (escape (path->abs file))))
157157
(set! str (substring-replace str "%u" (escape (path->uri file))))
158158
;; Replace capture groups with %0 %1 %2...
159-
(set! pattern (pattern-exec pattern file))
160-
(when pattern
159+
(when (and pattern (not (list? pattern)))
160+
(set! pattern (pattern-exec pattern file))
161161
(for-each
162162
(λ (i) (let ((captured (match:substring pattern i)))
163163
(when captured

0 commit comments

Comments
 (0)