Artifacts Associated With Ticket c0bc269178
Ticket change [ab139a23a5] (rid 204483) by apnadkarni on 2022-09-20 18:40:42:
- assignee initialized to: "nobody"
- closer initialized to: "nobody"
- cmimetype initialized to: "text/x-markdown"
- comment initialized to:
The third element of m below should be the empty string as the (b)? is not matched. ``` % switch -regexp -matchvar m -indexvar i ac { {(a)(b)?(c)} {puts m:$m; puts i:$i} } m:ac a ac c i:{0 1} {0 0} {-1 -1} {1 1} % info patch 8.7a6 ``` core-8-6-branch also exhibits this bug. **However, 8.6.12 shows correct behavior** ``` D:\src\ruff\doc\nroff>d:\tcl\magic\bin\tclsh.exe % switch -regexp -matchvar m -indexvar i ac { {(a)(b)?(c)} {puts m:$m; puts i:$i} } m:ac a {} c i:{0 1} {0 0} {-1 -1} {1 1} % info patch 8.6.12 ``` So clearly something was broken post-8.6.12 release. - foundin initialized to: "8.7"
- is_private initialized to: "0"
- login: "apnadkarni"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- severity initialized to: "Minor"
- status initialized to: "Open"
- submitter initialized to: "apnadkarni"
- subsystem initialized to: "- New Builtin Commands"
- title initialized to:
switch -regexp -matchvar -indexvar broken when optional subexpression does not match
- type initialized to: "Bug"
Ticket change [81fe00d01d] (rid 204484) by apnadkarni on 2022-09-20 18:50:44:
- foundin changed to: "8.6.13"
- icomment:
The bug seems to have been introduced with [this](https://core.tcl-lang.org/tcl/info/26539e78a71993cc) checkin on this [line](https://core.tcl-lang.org/tcl/file?ci=94f71d598512687b&name=generic/tclStringObj.c&ln=823). However, it seems a deliberate change so not clear to me that just reverting is the correct fix. /Ashok
- login: "apnadkarni"
- mimetype: "text/x-markdown"
- priority changed to: "7 High"
- subsystem changed to: "18. Commands M-Z"
Ticket change [5603d59098] (rid 204485) by dgp on 2022-09-20 19:06:49:
- icomment:
How did Tcl behave in release 8.6.10 ? See TIP 623 for more background.
- login: "dgp"
- mimetype: "text/plain"
- icomment:
Ticket change [45afa2d005] (rid 204491) by jan.nijtmans on 2022-09-20 20:44:39:
- assignee changed to: "jan.nijtmans"
- icomment:
Proposed fix [ea165f0333f93885|here] Thanks for the report, and for the testcase!
- login: "jan.nijtmans"
- mimetype: "text/x-fossil-wiki"
- resolution changed to: "Fixed"
- status changed to: "Pending"
Ticket change [a9ddb08836] (rid 204518) by jan.nijtmans on 2022-09-21 13:15:16:
- closedate changed to: "2459844.05227431"
- closer changed to: "jan.nijtmans"
- icomment: "Fix committed [92ab43ecd6cdd9a4|here]"
- login: "jan.nijtmans"
- mimetype: "text/x-fossil-wiki"
- status changed to: "Closed"