--- expect-5.43/Dbg.c 2002-03-22 20:11:54.000000000 -0800 +++ expect-5.43/Dbg.c.new 2008-10-17 15:28:14.000000000 -0700 @@ -660,7 +660,7 @@ /* calculate new frame */ if (-1 == TclGetFrame2(interp,trueFramePtr,viewFrameName, &iPtr->varFramePtr,debug_cmd)) { - print(interp,"%s\n",interp->result); + print(interp,"%s\n",Tcl_GetStringResult(interp)); Tcl_ResetResult(interp); } goto start_interact; @@ -970,7 +970,7 @@ savestr(&b->cmd,argv[0]); } - sprintf(interp->result,"%d",b->id); + sprintf(Tcl_GetStringResult(interp),"%d",b->id); return(TCL_OK); break_fail: @@ -1235,8 +1235,8 @@ switch (rc) { case TCL_OK: - if (*interp->result != 0) - print(interp,"%s\n",interp->result); + if (*Tcl_GetStringResult(interp) != 0) + print(interp,"%s\n",Tcl_GetStringResult(interp)); continue; case TCL_ERROR: print(interp,"%s\n",Tcl_GetVar(interp,"errorInfo",TCL_GLOBAL_ONLY)); --- expect-5.43/exp_command.c 2004-08-20 10:18:01.000000000 -0700 +++ expect-5.43/exp_command.c.new 2008-10-17 15:30:03.000000000 -0700 @@ -686,7 +686,7 @@ } if (TCL_OK != Tcl_SplitList(interp,argv[1],&n,&list)) { - expErrorLogU(interp->result); + expErrorLogU(Tcl_GetStringResult(interp)); expErrorLogU("\r\n"); exp_error(interp,"usage: -trap {siglist} ..."); return TCL_ERROR; @@ -877,8 +877,8 @@ sprintf(value,"%d",esPtr->fd_slave); Tcl_SetVar2(interp,SPAWN_OUT,"slave,fd",value,0); } - sprintf(interp->result,"%d",EXP_NOPID); - expDiagLog("spawn: returns {%s}\r\n",interp->result); + sprintf(Tcl_GetStringResult(interp),"%d",EXP_NOPID); + expDiagLog("spawn: returns {%s}\r\n",Tcl_GetStringResult(interp)); return TCL_OK; } @@ -989,8 +989,8 @@ /* tell user of new spawn id */ Tcl_SetVar(interp,SPAWN_ID_VARNAME,esPtr->name,0); - sprintf(interp->result,"%d",pid); - expDiagLog("spawn: returns {%s}\r\n",interp->result); + sprintf(Tcl_GetStringResult(interp),"%d",pid); + expDiagLog("spawn: returns {%s}\r\n",Tcl_GetStringResult(interp)); Tcl_DStringFree(&dstring); return(TCL_OK); @@ -1266,7 +1266,7 @@ if (!(esPtr = expStateCurrent(interp,0,0,0))) return TCL_ERROR; } - sprintf(interp->result,"%d",esPtr->pid); + sprintf(Tcl_GetStringResult(interp),"%d",esPtr->pid); return TCL_OK; usage: exp_error(interp,"usage: -i spawn_id"); @@ -1282,7 +1282,7 @@ char **argv; { expDiagLog("getpid is deprecated, use pid\r\n"); - sprintf(interp->result,"%d",getpid()); + sprintf(Tcl_GetStringResult(interp),"%d",getpid()); return(TCL_OK); } @@ -2113,7 +2113,7 @@ exp_error(interp,"usage: [-info|1|0]"); } - sprintf(interp->result,"%d",old_loguser); + sprintf(Tcl_GetStringResult(interp),"%d",old_loguser); return(TCL_OK); } @@ -2133,7 +2133,7 @@ if (argc > 3) goto usage; if (argc == 1) { - sprintf(interp->result,"%d",exp_tcl_debugger_available); + sprintf(Tcl_GetStringResult(interp),"%d",exp_tcl_debugger_available); return TCL_OK; } @@ -2161,7 +2161,7 @@ Dbg_On(interp,now); exp_tcl_debugger_available = 1; } - sprintf(interp->result,"%d",exp_tcl_debugger_was_available); + sprintf(Tcl_GetStringResult(interp),"%d",exp_tcl_debugger_was_available); return(TCL_OK); usage: exp_error(interp,"usage: [[-now] 1|0]"); @@ -2382,7 +2382,7 @@ static Tcl_Trace trace_handle; if (argc > 1 && streq(argv[1],"-info")) { - sprintf(interp->result,"%d",trace_level); + sprintf(Tcl_GetStringResult(interp),"%d",trace_level); return TCL_OK; } @@ -2654,14 +2654,14 @@ /* non-portable assumption that pid_t can be printed with %d */ if (result == -1) { - sprintf(interp->result,"%d %s -1 %d POSIX %s %s", + sprintf(Tcl_GetStringResult(interp),"%d %s -1 %d POSIX %s %s", esPtr->pid,spawn_id,errno,Tcl_ErrnoId(),Tcl_ErrnoMsg(errno)); result = TCL_OK; } else if (result == NO_CHILD) { exp_error(interp,"no children"); return TCL_ERROR; } else { - sprintf(interp->result,"%d %s 0 %d", + sprintf(Tcl_GetStringResult(interp),"%d %s 0 %d", esPtr->pid,spawn_id,WEXITSTATUS(esPtr->wait)); if (WIFSIGNALED(esPtr->wait)) { Tcl_AppendElement(interp,"CHILDKILLED"); @@ -2721,8 +2721,8 @@ } /* both child and parent follow remainder of code */ - sprintf(interp->result,"%d",rc); - expDiagLog("fork: returns {%s}\r\n",interp->result); + sprintf(Tcl_GetStringResult(interp),"%d",rc); + expDiagLog("fork: returns {%s}\r\n",Tcl_GetStringResult(interp)); return(TCL_OK); } --- expect-5.43/expect.c 2004-07-06 16:26:02.000000000 -0700 +++ expect-5.43/expect.c.new 2008-10-17 15:31:05.000000000 -0700 @@ -1357,7 +1357,7 @@ if (msg) { /* unusual way of handling error return */ /* because of Tcl's variable tracing */ - strcpy(interp->result,msg); + strcpy(Tcl_GetStringResult(interp),msg); result = TCL_ERROR; goto indirect_update_abort; } @@ -2078,7 +2078,7 @@ exp_cmdtype_printable(ecmd->cmdtype))) { static char msg[200]; sprintf(msg,"%s from indirect variable (%s)", - interp->result,exp_i->variable); + Tcl_GetStringResult(interp),exp_i->variable); return msg; } } @@ -2667,11 +2667,11 @@ } else { tm = localtime(&seconds); } -/* exp_strftime(interp->result,TCL_RESULT_SIZE,format,tm);*/ +/* exp_strftime(Tcl_GetStringResult(interp),TCL_RESULT_SIZE,format,tm);*/ exp_strftime(format,tm,&dstring); Tcl_DStringResult(interp,&dstring); } else { - sprintf(interp->result,"%ld",seconds); + sprintf(Tcl_GetStringResult(interp),"%ld",seconds); } return TCL_OK; @@ -2732,7 +2732,7 @@ } else { size = esPtr->umsize; } - sprintf(interp->result,"%d",size); + sprintf(Tcl_GetStringResult(interp),"%d",size); return(TCL_OK); } @@ -2806,7 +2806,7 @@ } else { value = esPtr->rm_nulls; } - sprintf(interp->result,"%d",value); + sprintf(Tcl_GetStringResult(interp),"%d",value); return(TCL_OK); } @@ -2879,7 +2879,7 @@ } else { parity = esPtr->parity; } - sprintf(interp->result,"%d",parity); + sprintf(Tcl_GetStringResult(interp),"%d",parity); return(TCL_OK); } @@ -2948,7 +2948,7 @@ } else { close_on_eof = esPtr->close_on_eof; } - sprintf(interp->result,"%d",close_on_eof); + sprintf(Tcl_GetStringResult(interp),"%d",close_on_eof); return(TCL_OK); } --- expect-5.43/exp_main_exp.c 2002-04-16 13:47:46.000000000 -0700 +++ expect-5.43/exp_main_exp.c.new 2008-10-17 15:31:34.000000000 -0700 @@ -24,12 +24,12 @@ Tcl_FindExecutable(argv[0]); if (Tcl_Init(interp) == TCL_ERROR) { - fprintf(stderr,"Tcl_Init failed: %s\n",interp->result); + fprintf(stderr,"Tcl_Init failed: %s\n",Tcl_GetStringResult(interp)); (void) exit(1); } if (Expect_Init(interp) == TCL_ERROR) { - fprintf(stderr,"Expect_Init failed: %s\n",interp->result); + fprintf(stderr,"Expect_Init failed: %s\n",Tcl_GetStringResult(interp)); (void) exit(1); } --- expect-5.43/exp_main_sub.c 2004-07-01 18:00:06.000000000 -0700 +++ expect-5.43/exp_main_sub.c.new 2008-10-17 15:32:31.000000000 -0700 @@ -223,10 +223,10 @@ char *msg; /* if errorInfo has something, print it */ - /* else use what's in interp->result */ + /* else use what's in Tcl_GetStringResult(interp) */ msg = Tcl_GetVar(interp,"errorInfo",TCL_GLOBAL_ONLY); - if (!msg) msg = interp->result; + if (!msg) msg = Tcl_GetStringResult(interp); else if (check_for_nostack) { /* suppress errorInfo if generated via */ /* error ... -nostack */ @@ -488,7 +488,7 @@ if (tcl_major < NEED_TCL_MAJOR || (tcl_major == NEED_TCL_MAJOR && tcl_minor < NEED_TCL_MINOR)) { - sprintf(interp->result, + sprintf(Tcl_GetStringResult(interp), "%s compiled with Tcl %d.%d but needs at least Tcl %d.%d\n", exp_argv0,tcl_major,tcl_minor, NEED_TCL_MAJOR,NEED_TCL_MINOR); @@ -812,8 +812,8 @@ expErrorLog("error executing system initialization file: %s\r\n",file); if (rc != TCL_ERROR) expErrorLog("Tcl_Eval = %d\r\n",rc); - if (*interp->result != 0) { - expErrorLogU(interp->result); + if (*Tcl_GetStringResult(interp) != 0) { + expErrorLogU(Tcl_GetStringResult(interp)); expErrorLogU("\r\n"); } /* SF #439042 -- Allow overide of "exit" by user / script @@ -840,8 +840,8 @@ expErrorLog("error executing file: %s\r\n",file); if (rc != TCL_ERROR) expErrorLog("Tcl_Eval = %d\r\n",rc); - if (*interp->result != 0) { - expErrorLogU(interp->result); + if (*Tcl_GetStringResult(interp) != 0) { + expErrorLogU(Tcl_GetStringResult(interp)); expErrorLogU("\r\n"); } /* SF #439042 -- Allow overide of "exit" by user / script --- expect-5.43/exp_main_tk.c 2003-07-31 11:27:20.000000000 -0700 +++ expect-5.43/exp_main_tk.c.new 2008-10-17 15:36:50.000000000 -0700 @@ -441,7 +441,7 @@ int i; if (argc == 0) { - strcpy(interp->result,"-Debug flag needs 1 or 0 argument"); + Tcl_SetResult(interp,"-Debug flag needs 1 or 0 argument",TCL_STATIC); return -1; } --- expect-5.43/exp_tty.c 2004-05-07 09:23:26.000000000 -0700 +++ expect-5.43/exp_tty.c.new 2008-10-17 15:39:51.000000000 -0700 @@ -451,7 +451,7 @@ argv++; no_args = FALSE; } else { - exp_win_rows_get(interp->result); + exp_win_rows_get(Tcl_GetStringResult(interp)); return TCL_OK; } } else if (streq(*argv,"columns")) { @@ -460,7 +460,7 @@ argv++; no_args = FALSE; } else { - exp_win_columns_get(interp->result); + exp_win_columns_get(Tcl_GetStringResult(interp)); return TCL_OK; } } else { @@ -495,7 +495,7 @@ /* if no result, make a crude one */ if (0 == strcmp(Tcl_GetString(Tcl_GetObjResult(interp)),"")) { - sprintf(interp->result,"%sraw %secho", + sprintf(Tcl_GetStringResult(interp),"%sraw %secho", (was_raw?"":"-"), (was_echo?"":"-")); } @@ -513,7 +513,7 @@ argv++; no_args = FALSE; } else { - exp_win2_rows_get(fd,interp->result); + exp_win2_rows_get(fd,Tcl_GetStringResult(interp)); goto done; } } else if (streq(*argv,"columns")) { @@ -522,7 +522,7 @@ argv++; no_args = FALSE; } else { - exp_win2_columns_get(fd,interp->result); + exp_win2_columns_get(fd,Tcl_GetStringResult(interp)); goto done; } } else if (streq(*argv,"<")) { @@ -629,7 +629,7 @@ return(TCL_ERROR); } if (cmd_is_stty) { - sprintf(interp->result,"%sraw %secho", + sprintf(Tcl_GetStringResult(interp),"%sraw %secho", (was_raw?"":"-"), (was_echo?"":"-")); } @@ -689,7 +689,7 @@ } if (cmd_is_stty) { - sprintf(interp->result,"%sraw %secho", + sprintf(Tcl_GetStringResult(interp),"%sraw %secho", (was_raw?"":"-"), (was_echo?"":"-")); } @@ -770,7 +770,7 @@ } } - if (abnormalExit && (*interp->result == 0)) { + if (abnormalExit && (*Tcl_GetStringResult(interp) == 0)) { Tcl_AppendResult(interp, "child process exited abnormally", (char *) NULL); }