Tk Library Source Code

View Ticket
Login
Ticket UUID: 1774990
Title: vwait dies when given varname with spaces
Type: Bug Version: None
Submitter: boakley Created on: 2007-08-15 21:09:11
Subsystem: comm Assigned To: andreas_kupries
Priority: 9 Immediate Severity:
Status: Closed Last Modified: 2007-08-16 04:33:43
Resolution: Fixed Closed By: andreas_kupries
    Closed on: 2007-08-15 21:33:43
Description:
When comm is loaded it overrides vwait, but has a bug in the implementation that manifests itself when the vwait variable has spaces in it. I get the error:

wrong # args: should be "::comm::VwaitOrig name"
    while executing
"vwait [::itcl::scope flag]"
...
    

This is due to the following line of code in vwait.tcl:

set code [catch {uplevel 1 ::comm::VwaitOrig $varname} res]

I think that should be (note the use of list):

set code [catch {uplevel 1 [list ::comm::VwaitOrig $varname]} res]

As an aside, you may be saying "why would anyone use a variable name with spaces?". As you can see in the above error message, I'm vwait'ing on an itcl public variable, which resolves to something like "@itcl ::foo ::Foo::flag". When it gets eval'd by the upvar those spaces naturally cause havoc.
User Comments: andreas_kupries added on 2007-08-16 04:33:43:
Logged In: YES 
user_id=75003
Originator: NO

Fixed in the CVS head, comm version 4.5.6.