Menu

#142 return in configbody scripts

3.3.0
closed-out-of-date
nobody
Other (66)
5
2014-09-20
2006-10-05
Tony B
No

use of [return] in a configbody script returns
TCL_RETURN (2) to the calling code
(Itcl_BiConfigureCmd()or ItclHandleConfig) which treats
anything but TCL_OK (0) as an error and so resets the
public variable. The result code (TCL_RETURN) is passed
back up the calling stack which doesn't treat this as
error. Itcl_BiConfigureCmd (itcl_bicmds.c) and
ItclHandleConfig (itcl_methods.c) need fixing to allow
the use of return in configbody scripts.

Also, if the public variable doesn't exist prior to an
error being thrown in an configbody script then it is
set to "" rather than being unset.

Discussion

  • Tony B

    Tony B - 2006-10-16

    Logged In: YES
    user_id=1157191

    submiited patch to fix use of return in config body scripts
    + restore of old value on error

     
  • Tony B

    Tony B - 2006-10-16

    Patch to fix use of return in config body scripts

     
  • David Gravereaux

    • assigned_to: davygrvy --> nobody
     
  • David Gravereaux

    Tony, could you post some use case examples to show what is bad along with a what should be example? Thanks.

     
  • Arnulf Wiedemann

    • status: open --> closed-out-of-date
     

Log in to post a comment.