Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2007-07-06
01:03 • Closed ticket [1743676fff]: inconsistent error messages plus 8 other changes artifact: d1b35b2e4a user: dgp
2007-06-26
23:05 • Ticket [1743676fff]: 4 changes artifact: af0f328fc9 user: dgp
23:03 • Ticket [1743676fff]: 4 changes artifact: b542593345 user: dgp
22:55 • Ticket [1743676fff]: 4 changes artifact: 7e80af0014 user: lvirden
22:33 • Ticket [1743676fff]: 5 changes artifact: bcbdbc18e7 user: msofer
15:26 • New ticket [1743676fff]. artifact: d0e03c0d4b user: lvirden

inconsistent error messages

Closed / Fixed1743676fffffffffffffffffffffffffffffffffCreated 19 years agoUpdated 19 years ago
Descriptionplain2007-06-26 15:26:11
 $ tclsh
% lwv 5
invalid command name "lwv"
% "" 5
empty command name ""
% {} 5
empty command name ""
% { } 5
invalid command name " "



For some reason, a proc named {} which has not yet been defined generates a different message than other procs that have not yet been defined.
msoferplain2007-06-26 22:33:00
Logged In: YES 
user_id=148712
Originator: NO

Comment in init.tcl, line 407:
  # Handle empty $name separately due to strangeness in [string first]

Anybody knows what this strangeness is?
lvirdenplain2007-06-26 22:55:33
Logged In: YES 
user_id=15949
Originator: YES

Right below that point of init.tcl I see the following:

        # Filter out bogus matches when $name contained
        # a glob-special char [Bug 946952]
        set cmds [list]
        foreach x $candidates {
            if {[string first $name $x] == 0} {
                lappend cmds $x
            }
        }

Now, if I say:

 string first {} {}

the response is -1, rather than 0.

I suspect that is what is trying to be worked around.
dgpplain2007-06-26 23:03:44
Logged In: YES 
user_id=80530
Originator: NO


See 1243354.

Meanwhile, it appears a
simple s/empty/invalid/ is in order;
correct?
dgpplain2007-06-26 23:05:35
Logged In: YES 
user_id=80530
Originator: NO


actually, no, a better [string first]
would lead to the
"ambiguous command name..." message.
dgpplain2007-07-06 01:03:06
Logged In: YES 
user_id=80530
Originator: NO

fix committed to both branches
Log in (anonymous is fine) to add a comment.