Skip to content
Tcl Source Code History Of Ticket 755335ffffffffffffffffffffffffffffffffff
Login

History Of Ticket 755335ffffffffffffffffffffffffffffffffff

Artifacts Associated With Ticket 755335ffffffffffffffffffffffffffffffffff

  1. Ticket change [b170814923] (rid 98142) by vincentdarley on 2003-06-16 14:11:55:

    1. assignee initialized to: "dkf"
    2. cmimetype initialized to: "text/plain"
    3. 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'.
      
      
      
      
      
    4. foundin initialized to: "obsolete: 8.4.3"
    5. priority initialized to: "5 Medium"
    6. resolution initialized to: "None"
    7. status initialized to: "Open"
    8. submitter initialized to: "vincentdarley"
    9. subsystem initialized to: "18. Commands M-Z"
    10. title initialized to: "regsub won't substitute against an empty string"
    11. type initialized to: "Bug"
  2. Ticket change [fa1bbaf5fa] (rid 91819) by vincentdarley on 2003-06-17 00:09:16:

    1. 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.
      
      
      
    2. login: "vincentdarley"
    3. mimetype: "text/plain"
    4. username: "vincentdarley"
  3. Add attachment "regsubfix.patch" [9b37b78404] (rid 111090) by vincentdarley on 2003-06-17 16:39:44.

  4. Ticket change [8df6804532] (rid 128033) by vincentdarley on 2003-06-17 16:39:44:

    1. 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.
      
      
      
    2. login: "vincentdarley"
    3. mimetype: "text/plain"
    4. username: "vincentdarley"
  5. Ticket change [f60a536b13] (rid 130224) by vincentdarley on 2003-06-17 16:39:45:

    1. icomment:
      
      
      File Added - 53332: regsubfix.patch
      
      
      
    2. login: "vincentdarley"
    3. mimetype: "text/plain"
    4. username: "vincentdarley"
  6. Ticket change [ac0c9b7136] (rid 101225) by vincentdarley on 2003-06-17 19:15:44:

    1. 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"
      
      
      
    2. login: "vincentdarley"
    3. mimetype: "text/plain"
    4. username: "vincentdarley"
  7. Ticket change [15499e1b5d] (rid 124545) by dkf on 2003-06-17 23:41:27:

    1. assignee changed to: "vincentdarley"
    2. 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.)
      
      
    3. login: "dkf"
    4. mimetype: "text/plain"
    5. username: "dkf"
  8. Ticket change [250b723448] (rid 131215) by vincentdarley on 2003-06-18 03:37:53:

    1. closedate changed to: "2003-06-17T20:37:53"
    2. closer changed to: "vincentdarley"
    3. 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...
      
      
      
    4. login: "vincentdarley"
    5. mimetype: "text/plain"
    6. resolution changed to: "Fixed"
    7. status changed to: "Closed"
    8. username: "vincentdarley"