Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2004-07-07
04:07 • Closed ticket [986195ffff]: TclWordKnownAtCompileTime copies word, not value... artifact: 145ea25076 user: dgp
03:40 • Ticket [986195ffff]: 1 change artifact: e24c81c548 user: dgp
03:40 • Ticket [986195ffff]: 4 changes artifact: 403032a461 user: dgp
2004-07-06
20:14 • New ticket [986195ffff]. artifact: 8e9528deec user: kennykb

TclWordKnownAtCompileTime copies word, not value

Closed / Fixed986195ffffffffffffffffffffffffffffffffffCreated 22 years agoUpdated 22 years ago
Descriptionplain2004-07-06 20:14:28
test cmdMZ-return-2.15 {return opton handling} -setup {
        proc p {} {
            return -code error -errorcode {a b} c
        }
    } -body {
        list [catch p result] $result $::errorCode
    } -cleanup {
        rename p {}
    } -result {1 c {a b}}

gives an extra pair of braces around the error code.
On the other hand,

test cmdMZ-return-2.16 {return opton handling} -setup {
        proc p {} {
            return -code error -errorcode [list a b] c
        }
    } -body {
        list [catch p result] $result $::errorCode
    } -cleanup {
        rename p {}
    } -result {1 c {a b}}

gives the expected result
dgpplain2004-07-07 03:40:07
Logged In: YES 
user_id=80530


This is a flaw in
TclWorkKnownAtCompileTime().
dgp Ticket [986195ffff]: 1 change [History diff]2004-07-07 03:40:59
dgpplain2004-07-07 04:07:44
Logged In: YES 
user_id=80530


For a TCL_TOKEN_SIMPLE_WORD,
the entire word (with {}) was copied,
instead of the value.

The other branch that covered
backslash quoting was also buggy.

Fixes committed.
Log in (anonymous is fine) to add a comment.