Artifacts Associated With Ticket 697b1bbfe3
Ticket change [834398468f] (rid 204374) by erikleunissen on 2022-09-18 11:30:05:
- assignee initialized to: "nobody"
- closer initialized to: "nobody"
- cmimetype initialized to: "text/x-fossil-plain"
- comment initialized to:
Here are the results of six invocations of the "regexp" command. They indicate incorrect argument handling. % set str "a-z" a-z % regexp - $str; #1 bad option "-": must be -all, -about, -indices, -inline, -expanded, -line, -linestop, -lineanchor, -nocase, -start, or -- % regexp \- $str; #2 1 % regexp {-} $str; #3 bad option "-": must be -all, -about, -indices, -inline, -expanded, -line, -linestop, -lineanchor, -nocase, -start, or -- % regexp -\\ $str; #4 couldn't compile regular expression pattern: invalid escape \ sequence % regexp \\- $str; #5 1 % set initstring "-" - % regexp $initstring $str; #6 1 % This discussion thread at c.l.t. provides some clues: https://groups.google.com/g/comp.lang.tcl/c/pbqqj8tcIUk - foundin initialized to: "trunk"
- is_private initialized to: "0"
- login: "erikleunissen"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- severity initialized to: "Minor"
- status initialized to: "Open"
- submitter initialized to: "erikleunissen"
- subsystem initialized to: "18. Commands M-Z"
- title initialized to: "Incorrect argument handling by [regexp]"
- type initialized to: "Bug"
Ticket change [ae26d49811] (rid 257538) by serhiy.storchaka on 2026-10-10 21:12:12:
- icomment:
Still the same in 8.6, 9.0 and 9.1. Cases #1, #3 and #5 are correct: an argument starting with "-" is taken as an option unless it follows <tt>--</tt>. #2 and #4 differ from the command only in compiled code: the bytecode compiler checked for a leading "-" only in words without backslashes, so <tt>\-</tt> and <tt>-\\</tt> were compiled as patterns. #6 (a pattern in a variable) is the same problem as [1902890fff]. Proposed fix for #2 and #4 in branch [/timeline?r=regexp-compile-dash-pattern|regexp-compile-dash-pattern]: the compiler checks the value of any word known at compile time, as for <tt>regsub</tt>, so both now give "bad option" as in #1. Tests regexpComp-24.12 to 24.15.
- login: "serhiy.storchaka"
- mimetype: "text/x-fossil-wiki"
- icomment:
Ticket change [cc6ba518d4] (rid 257539) by serhiy.storchaka on 2026-10-10 21:12:29:
- foundin changed to: "8.6.18, 9.0.5, 9.1.0"
- login: "serhiy.storchaka"
Ticket change [c78524a5f0] (rid 257563) by serhiy.storchaka on 2026-10-11 07:39:52:
- icomment:
Proposed fix for case #6 in branch [/timeline?r=regexp-compile-runtime-switch|regexp-compile-runtime-switch], see [1902890fff].
- login: "serhiy.storchaka"
- mimetype: "text/x-fossil-wiki"
- icomment:
Ticket change [15facf6005] (rid 261313) by dkf on 2026-11-08 20:53:27:
- login: "dkf"
- mimetype: "text/plain"
- subsystem changed to: "43. Regexp"
Ticket change [3e0e8a1136] (rid 261887) by jan.nijtmans on 2026-11-18 17:42:21:
- assignee changed to: "jan.nijtmans"
- icomment:
Fixed in [6e93204003|trunk] and core-9-0-branch Many thanks! Would be nice to backport this to 8.6.19 as well.
- login: "jan.nijtmans"
- mimetype: "text/x-fossil-wiki"
- resolution changed to: "Fixed"
- status changed to: "Pending"
Ticket change [3afa410f3b] (rid 261913) by serhiy.storchaka on 2026-11-18 18:27:58:
- icomment:
Backported to core-8-6-branch: [b0610ccd6f]. In 8.6, <tt>regexp \- a-z</tt> reports "bad option" instead of 9.0's "ambiguous option", compiled and uncompiled alike, so regexpComp-24.12 expects that.
- login: "serhiy.storchaka"
- mimetype: "text/x-fossil-wiki"
- icomment:
Ticket change [5e808a5aa2] (rid 261917) by serhiy.storchaka on 2026-11-18 18:32:47:
- closedate changed to: "2461363.272776770872"
- closer changed to: "serhiy.storchaka"
- login: "serhiy.storchaka"
- resolution changed to: "Fixed"
- status changed to: "Closed"