Overview
| Artifact ID: | ab139a23a5b47382791b66b22d0509e539006e9bb9a0812725b70cf4f0dd2360 |
|---|---|
| Ticket: | c0bc269178df938974e19cbe60e69fc0e711da5f
switch -regexp -matchvar -indexvar broken when optional subexpression does not match |
| User & Date: | apnadkarni on 2022-09-20 18:40:42 |
Changes
- assignee changed to: "nobody"
- closer changed to: "nobody"
- cmimetype changed to: "text/x-markdown"
- comment changed 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 changed to: "8.7"
- is_private changed to: "0"
- login: "apnadkarni"
- priority changed to: "5 Medium"
- resolution changed to: "None"
- severity changed to: "Minor"
- status changed to: "Open"
- submitter changed to: "apnadkarni"
- subsystem changed to: "- New Builtin Commands"
- title changed to:
switch -regexp -matchvar -indexvar broken when optional subexpression does not match
- type changed to: "Bug"