Artifacts Associated With Ticket 755335ffffffffffffffffffffffffffffffffff
Ticket change [b170814923] (rid 98142) by vincentdarley on 2003-06-16 14:11:55:
- assignee initialized to: "dkf"
- cmimetype initialized to: "text/plain"
- comment initialized to:
Despite the fact that patterns like '^' can and do match the empty string, 'regsub' will refuse to acknowledge them and refuse to perform substitutions. For example: GOOD: % regexp -- ^ {} 1 BAD: % regsub -- ^ {} {replace} var 0 % set var <empty string> Of course this should replace '{}' with 'replace'. - foundin initialized to: "obsolete: 8.4.3"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "vincentdarley"
- subsystem initialized to: "18. Commands M-Z"
- title initialized to: "regsub won't substitute against an empty string"
- type initialized to: "Bug"
Ticket change [fa1bbaf5fa] (rid 91819) by vincentdarley on 2003-06-17 00:09:16:
- icomment:
Logged In: YES user_id=32170 Here's another regsub issue: % regsub -all -lineanchor -- {^#[^\n]*\n} \ "#one\n#two\n#three\n" foo\n foo #two foo I believe the buggy line is tclCmdMZ.c:734: match = Tcl_RegExpExecObj(interp, regExpr, objPtr, offset, 10 /* matches */, ((offset > 0) ? TCL_REG_NOTBOL : 0)); where 'TCL_REG_NOTBOL' should only be added as a flag if offset>0 _and_ the the 'offset-1'th character of objPtr is not a newline. - login: "vincentdarley"
- mimetype: "text/plain"
- username: "vincentdarley"
- icomment:
Add attachment "regsubfix.patch" [9b37b78404] (rid 111090) by vincentdarley on 2003-06-17 16:39:44.
Ticket change [8df6804532] (rid 128033) by vincentdarley on 2003-06-17 16:39:44:
- icomment:
Logged In: YES user_id=32170 The attached patch I believe fixes these problems, although I can't test it since the windows build is still broken.
- login: "vincentdarley"
- mimetype: "text/plain"
- username: "vincentdarley"
- icomment:
Ticket change [f60a536b13] (rid 130224) by vincentdarley on 2003-06-17 16:39:45:
- icomment:
File Added - 53332: regsubfix.patch
- login: "vincentdarley"
- mimetype: "text/plain"
- username: "vincentdarley"
- icomment:
Ticket change [ac0c9b7136] (rid 101225) by vincentdarley on 2003-06-17 19:15:44:
- icomment:
Logged In: YES user_id=32170 Here are some new tests which ought to cover the problems seen. test regexp-21.1 {regsub works with empty string} { regsub -- ^ {} foo } {foo} test regexp-21.2 {regsub works with empty string} { regsub -- \$ {} foo } {foo} test regexp-21.3 {regsub works with empty string offset} { regsub -start 0 -- ^ {} foo } {foo} test regexp-21.4 {regsub works with empty string offset} { regsub -start 0 -- \$ {} foo } {foo} test regexp-21.5 {regsub works with empty string offset} { regsub -start 3 -- \$ {123} foo } {123foo} test regexp-21.6 {regexp works with empty string} { regexp -- ^ {} } {1} test regexp-21.7 {regexp works with empty string} { regexp -start 0 -- ^ {} } {1} test regexp-21.8 {regexp works with empty string offset} { regexp -start 3 -- ^ {123} } {0} test regexp-21.9 {regexp works with empty string offset} { regexp -start 3 -- \$ {123} } {1} test regexp-21.10 {multiple matches handle newlines} { regsub -all -lineanchor -- {^#[^\n] *\n} "#one\n#two\n#three\n" foo\n } "foo\nfoo\nfoo\n" - login: "vincentdarley"
- mimetype: "text/plain"
- username: "vincentdarley"
- icomment:
Ticket change [15499e1b5d] (rid 124545) by dkf on 2003-06-17 23:41:27:
- assignee changed to: "vincentdarley"
- icomment:
Logged In: YES user_id=79902 Can't review the patch in the middle of this meeting, but as you've got tests to detect the problem and whether it is fixed, I'm perfectly happy for you to fix this. Make sure the patch goes into the HEAD and the 8.4 branch, of course. :^) I assume this all depends on none of the various -line* options being specified? Or do they need separate testing? (Sometimes its just nice to add extra tests even if you know they'll pass.)
- login: "dkf"
- mimetype: "text/plain"
- username: "dkf"
Ticket change [250b723448] (rid 131215) by vincentdarley on 2003-06-18 03:37:53:
- closedate changed to: "2003-06-17T20:37:53"
- closer changed to: "vincentdarley"
- icomment:
Logged In: YES user_id=32170 Applied slightly modified patch to cvs head, so all of the quoted tests pass ok. Will also apply to 8.4 branch...
- login: "vincentdarley"
- mimetype: "text/plain"
- resolution changed to: "Fixed"
- status changed to: "Closed"
- username: "vincentdarley"