Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2001-04-21
02:37 • Ticket [218161ffff] Tcl_EvalFile() returns empty result string status still ... artifact: 537ec05f91 user: dgp
2000-10-26
08:15 • Closed ticket [218161ffff]. artifact: f9686350ae user: welch
00:53 • New ticket [218161ffff]. artifact: b827c1c752 user: nobody

Tcl_EvalFile() returns empty result string

Closed / Invalid218161ffffffffffffffffffffffffffffffffffCreated 26 years agoUpdated 26 years ago
Descriptionplain2000-10-26 00:53:56
OriginalBugID: 2205 Bug
Version: 8.0.5
SubmitDate: '1999-06-11'
LastModified: '1999-11-07'
Severity: SER
Status: Closed
Submitter: techsupp
ChangedBy: hobbs
OS: Other
OSVersion: UnixWare (Intel)
Machine: NA
FixedDate: '2000-10-25'
ClosedDate: '1999-11-07'


Name:
David Bradsher

CustomShell:
none

ReproducibleScript:
# script breaks here
      return 1
    --------------------
    C pgm:
    
      char   interp_res[256];
        .
        .
      if ( Tcl_EvalFile( mp_tcl_interp, p_filename ) != TCL_OK ) {
        .
        .
      }  
      strcpy( interp_val, mp_tcl_interp->result );
      return( atoi( interp_val ) );

ObservedBehavior:
The C application had been working while linked to version 7.4 of the
    Tcl libraries.  For the above instance, the C routine would return an
    integer '1' when the script terminated normally with "return 1".  With
    8.0.5, the result string has length 0, which atoi() translates to '0'.

DesiredBehavior:
The return from Tcl_EvalFile() should be the same as with version 7.4.



The desired behavior for this is misguided due to the fact that
8.0 uses Tcl_Obj's throughout.  It is likely in this case that
the result from Tcl_EvalFile, if 1, will be stored in the result
as an Tcl integer object, and thus 'result' char* will be empty
until it is requested as a string.  This is noted in the porting
docs.  The user should use Tcl_GetStringResult, which works in
Tcl7 and Tcl8. 
-- 11/07/1999 hobbs
welch Closed ticket [218161ffff]. [History diff]2000-10-26 08:15:57
dgp Ticket [218161ffff]: 4 changes [History diff]2001-04-21 02:37:44
Log in (anonymous is fine) to add a comment.