1 Submitted By: DJ Lucas <dj_AT_linuxfromscratch_DOT_org>
3 Initial Package Version: 5.43
4 Upstream status: Not Submitted
5 Origin: LFS ticket 2126 (http://wiki.linuxfromscratch.org/lfs/ticket/2126)
6 Bryan Kadzban <bryan@kadzban.is-a-geek.net>
7 Description: Removes references to functions that Tcl 8.5 no longer exposes
8 and correct other minor build problems WRT TCL-8.5.x.
10 diff -Naur expect-5.43-orig/Dbg.c expect-5.43/Dbg.c
11 --- expect-5.43-orig/Dbg.c 2002-03-22 22:11:54.000000000 -0600
12 +++ expect-5.43/Dbg.c 2008-08-24 01:30:15.000000000 -0500
18 +#include "expect_cf.h"
21 /* tclInt.h drags in stdlib. By claiming no-stdlib, force it to drag in */
22 diff -Naur expect-5.43-orig/exp_inter.c expect-5.43/exp_inter.c
23 --- expect-5.43-orig/exp_inter.c 2004-08-17 21:03:00.000000000 -0500
24 +++ expect-5.43/exp_inter.c 2008-08-24 01:28:59.000000000 -0500
32 #include "exp_tty_in.h"
33 diff -Naur expect-5.43/exp_command.c expect-5.43-patched/exp_command.c
34 --- expect-5.43/exp_command.c 2004-08-20 13:18:01.000000000 -0400
35 +++ expect-5.43-patched/exp_command.c 2008-01-12 11:42:45.000000000 -0500
40 +static struct exp_cmd_data cmd_data[];
44 Exp_CloseObjCmd(clientData, interp, objc, objv)
45 @@ -2311,12 +2313,23 @@
46 /* Historical note: we used "close" long before there was a */
47 /* Tcl builtin by the same name. */
49 + /* The code that registered this function as the handler for */
50 + /* the "close" command stored away the old handler in the */
51 + /* exp_cmd_data for the "close" command. */
53 + struct exp_cmd_data *cmd_ptr;
56 + for(cmd_ptr = &cmd_data[0]; cmd_ptr->name; cmd_ptr++) {
57 + if(strncmp(cmd_ptr->name, "close", 5) == 0)
61 Tcl_ResetResult(interp);
62 if (0 == Tcl_GetCommandInfo(interp,"close",&info)) {
65 - return(Tcl_CloseObjCmd(info.clientData,interp,objc_orig,objv_orig));
66 + return(cmd_ptr->old_objProc(info.clientData,interp,objc_orig,objv_orig));
70 @@ -2961,7 +2974,10 @@
71 /* if successful (i.e., TCL_RETURN is returned) */
72 /* modify the result, so that we will handle it specially */
74 - int result = Tcl_ReturnObjCmd(clientData,interp,objc,objv);
76 + Tcl_GetCommandInfo(interp, "return", &info);
78 + int result = info.objProc(clientData,interp,objc,objv);
79 if (result == TCL_RETURN)
80 result = EXP_TCL_RETURN;
85 /* if already defined, don't redefine */
86 - if ((c->flags & EXP_REDEFINE) ||
87 - !(Tcl_FindHashEntry(&globalNsPtr->cmdTable,c->name) ||
88 + if (!(Tcl_FindHashEntry(&globalNsPtr->cmdTable,c->name) ||
89 Tcl_FindHashEntry(&currNsPtr->cmdTable,c->name))) {
91 Tcl_CreateObjCommand(interp,c->name,
92 @@ -3072,6 +3087,21 @@
93 Tcl_CreateCommand(interp,c->name,c->proc,
94 c->data,exp_deleteProc);
96 + else if (c->flags & EXP_REDEFINE) { /* unless the REDEFINE flag is present */
99 + if (Tcl_GetCommandInfo(interp, c->name, &info)) {
100 + c->old_proc = info.proc;
101 + c->old_objProc = info.objProc;
105 + Tcl_CreateObjCommand(interp,c->name,
106 + c->objproc,c->data,exp_deleteObjProc);
108 + Tcl_CreateCommand(interp,c->name,c->proc,
109 + c->data,exp_deleteProc);
111 if (!(c->name[0] == 'e' &&
114 diff -Naur expect-5.43/exp_command.h expect-5.43-patched/exp_command.h
115 --- expect-5.43/exp_command.h 2008-01-12 11:44:11.000000000 -0500
116 +++ expect-5.43-patched/exp_command.h 2008-01-12 11:26:05.000000000 -0500
121 + Tcl_CmdProc *old_proc; /* these store the procedure for the old command, */
122 + Tcl_ObjCmdProc *old_objProc; /* if any */
125 EXTERN void exp_create_commands _ANSI_ARGS_((Tcl_Interp *,