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.