Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: cb4ff0496757834d56f0f128acc1d3aa5d675dff
Ticket: 1047097fffffffffffffffffffffffffffffffff
Possible parsing problem. "list" command inccorectly assigns
User & Date: nobody on 2004-10-14 15:06:02
Changes

  1. assignee changed to: "dkf"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    Synopsis of the bug:
    
      Possible issue with the way tcl parses list commands.
    
      1. If the list being passed to one of the list commands 
    is followed by any nonspace "terminator" character 
    (such as "[", ",", ".", "{", "}", ")", "\" and etc. ) and then 
    by any number of nonspace characters then space , all 
    those characters are being appended to the very last 
    element of the list while executing the command.
    
    Example:
    ----------
    input: join [list 1 2 3]\[ |
    output: 1|2|3[
    
    input: join [list 1 2 3]] |
    output: 1|2|3]
    
      2. If the list being passed to one of the list commands 
    is followed by any nonspace "terminator" character 
    (such as "[", ",", ".", "{", "}", ")", "\" and etc. ) and then 
    by any number of nonspace characters, then by "\", 
    then by a space character, and then again any number 
    of nonspace characters, all those characters before "\ " 
    are being appended to the very last element of the 
    passed list and all characters that goes after "\ " are 
    treated as an additional last element of the list while 
    executing the command.
    
    Example:
    ----------
    input: join $l\extra1\ extra2 |
    output: 1|2|3extra1|extra2
    
    Setup information:
      OS:  Windows 2000 Professional,
      TCL: Tcl version 8.3
    
    Steps to reproduce the bug:
      1. Bring up tclsh command prompt
    
      2. Initialize the list as below...
          input: set l [list 1 2 3]
          output: 1 2 3
    
      3. Try one of the operation below (join is used only as 
    an example any other list operation will manifest the 
    same issue)
    
    input: join $l] |
    output: 1|2|3]
    
    input: join $l{ |
    output: 1|2|3{
    
    input: join $l} |
    output: 1|2|3}
    
    input: join $l) |
    output: 1|2|3)
    
    input: join $l. |
    output: 1|2|3.
    
    input: join $l, |
    output: 1|2|3,
    
    input: join $l\asdf |
    output: 1|2|3sdf
    
    input: join $l\( |
    output: 1|2|3(
    
    input: join $l\[ |
    output: 1|2|3[
    
    input: join $l\] |
    output: 1|2|3]
    
    input: join $l\\ |
    output: 1|2|3\
    
    input: join [list 1 2 3]\[ |
    output: 1|2|3[
    
    input: join $l\extra1\ extra2 |
    output: 1|2|3extra1|extra2
    
    Expected result: Parsing error.
    
  4. foundin changed to: "final ----"
  5. priority changed to: "5 Medium"
  6. resolution changed to: "None"
  7. status changed to: "Open"
  8. submitter changed to: "nobody"
  9. subsystem changed to: "17. Commands I-L"
  10. title changed to:
    Possible parsing problem. "list" command inccorectly assigns
    
  11. type changed to: "Bug"