Skip to content
Tcl Source Code History Of Ticket 2845214fffffffffffffffffffffffffffffffff
Login

History Of Ticket 2845214fffffffffffffffffffffffffffffffff

Artifacts Associated With Ticket 2845214fffffffffffffffffffffffffffffffff

  1. Ticket change [b91ef6c62a] (rid 129078) by jestone on 2009-08-26 22:27:04:

    1. assignee initialized to: "nobody"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      The following script produces incorrect output for "stringb":
      set stringa "teststring_a.pdb"
      set stringb "teststring_b.pdb"
      set outa [string trimright $stringa ".pdb"]
      set outb [string trimright $stringb ".pdb"]
      puts "$stringa -> $outa"
      puts "$stringb -> $outb"
      
      With several recent Tcl versions, I get this output:
      teststring_a.pdb -> teststring_a
      teststring_b.pdb -> teststring_
      
      I would instead, expect this output to be correct:
      teststring_a.pdb -> teststring_a
      teststring_b.pdb -> teststring_b
      
      
      
    4. foundin initialized to: "None"
    5. is_private initialized to: "0"
    6. priority initialized to: "5 Medium"
    7. resolution initialized to: "None"
    8. status initialized to: "Open"
    9. submitter initialized to: "jestone"
    10. subsystem initialized to: "None"
    11. title initialized to:
      Malfunction of "string trimright" with certain strings 
      
    12. type initialized to: "Bug"
  2. Ticket change [0dcbc68728] (rid 114426) by andreas_kupries on 2009-08-27 05:39:08:

    1. icomment:
      No, this is not a bug.
      
      The string ".pdb" is not removed as a string. It is interpreted as a 'set of characters', and all characters in that set are removed. In your example the set contains the four characters {'.' 'p' 'd' 'b'}. Note the 'b'.
      
      And for "teststring_b.pdb" trimgright correctly removes the 'b' just before the underscore.
      
      Note the phrasing in the manpage (http://docs.activestate.com/activetcl/8.5/tcl/TclCmd/string.htm#M54):
       ... any trailing characters present in the string given by chars ...
      i.e. ... any ... character ... present in ... chars
      
      
      
      
      
      
      
    2. login: "andreas_kupries"
    3. mimetype: "text/plain"
    4. username: "andreas_kupries"
  3. Ticket change [4e846b9a66] (rid 125654) by andreas_kupries on 2009-08-27 05:39:14:

    1. assignee changed to: "andreas_kupries"
    2. closedate changed to: "2009-08-26T22:39:14"
    3. closer changed to: "andreas_kupries"
    4. icomment:
      
      
      allow_comments - 1
      
      
      
    5. login: "andreas_kupries"
    6. mimetype: "text/plain"
    7. resolution changed to: "Invalid"
    8. status changed to: "Closed"
    9. subsystem changed to: "18. Commands M-Z"
    10. username: "andreas_kupries"