Tcl Source Code

View Ticket
Login
Ticket UUID: 1997860
Title: Tcl_GetInterpPath : minor bug in result affectation
Type: Bug Created on: 2008-06-19 13:31:45
Submitter: nicolascastagne Assigned to: hobbs
Subsystem: 20. [interp] Severity:
Priority: 5 Medium Last modified: 2026-10-22 17:19:30
Status: Closed Closed by: serhiy.storchaka
Resolution: Fixed Closed on: 2026-10-21 10:03:36
Version: obsolete: 8.5.2
Description:
As far as I checked,
   Tcl_GetInterpPath
appends the slave's path to the current master's result, instead of setting the master's result.

The following code (sorry for mixing Qt, but eh, it should be easy to understand !) :

qDebug () << Tcl_GetStringResult A: "<< Tcl_GetStringResult(_interpMaster);
Tcl_GetInterpPath(_interpMaster, _interpSlave);
qDebug () << Tcl_GetStringResult B: "<<  Tcl_GetStringResult(_interpMaster);

Tcl_GetInterpPath(_interpMaster, _interpSlave);
qDebug () << Tcl_GetStringResult C: "<<  Tcl_GetStringResult(_interpMaster);

produces the output :
Tcl_GetStringResult A: 
Tcl_GetStringResult B: slaveName
Tcl_GetStringResult C: slaveName slaveName

instead of :
Tcl_GetStringResult A: 
Tcl_GetStringResult B: slaveName
Tcl_GetStringResult C: slaveName 

Just a minor bug, but the behavior is not conform to what doc says !

Best-
User Comments:
serhiy.storchaka added on 2026-10-21 10:03:36:

Fixed in 8.6.0 by [b074e043df]: Tcl_GetInterpPath now resets the result before building the path.