]> git.ipfire.org Git - people/arne_f/ipfire-3.x.git/blob - expect/patches/expect-5.43.0-tcl_8.5.8_fix-1.patch
Change file layout of the makefiles.
[people/arne_f/ipfire-3.x.git] / expect / patches / expect-5.43.0-tcl_8.5.8_fix-1.patch
1 Submitted By: DJ Lucas <dj_AT_linuxfromscratch_DOT_org>
2 Date: 2008-09-28
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.
9
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
13 @@ -9,7 +9,7 @@
14 */
15
16 #include <stdio.h>
17 -
18 +#include "expect_cf.h"
19 #include "tcldbgcf.h"
20 #if 0
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
25 @@ -36,6 +36,7 @@
26 #include <ctype.h>
27
28 #include "tcl.h"
29 +#include "tclInt.h"
30 #include "string.h"
31
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
36 @@ -2265,6 +2265,8 @@
37 /*NOTREACHED*/
38 }
39
40 +static struct exp_cmd_data cmd_data[];
41 +
42 /*ARGSUSED*/
43 static int
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. */
48
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. */
52 +
53 + struct exp_cmd_data *cmd_ptr;
54 Tcl_CmdInfo info;
55 +
56 + for(cmd_ptr = &cmd_data[0]; cmd_ptr->name; cmd_ptr++) {
57 + if(strncmp(cmd_ptr->name, "close", 5) == 0)
58 + break;
59 + }
60 +
61 Tcl_ResetResult(interp);
62 if (0 == Tcl_GetCommandInfo(interp,"close",&info)) {
63 info.clientData = 0;
64 }
65 - return(Tcl_CloseObjCmd(info.clientData,interp,objc_orig,objv_orig));
66 + return(cmd_ptr->old_objProc(info.clientData,interp,objc_orig,objv_orig));
67 }
68
69 if (chanName) {
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 */
73
74 - int result = Tcl_ReturnObjCmd(clientData,interp,objc,objv);
75 + Tcl_CmdInfo info;
76 + Tcl_GetCommandInfo(interp, "return", &info);
77 +
78 + int result = info.objProc(clientData,interp,objc,objv);
79 if (result == TCL_RETURN)
80 result = EXP_TCL_RETURN;
81 return result;
82 @@ -3062,8 +3078,7 @@
83
84 for (;c->name;c++) {
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))) {
90 if (c->objproc)
91 Tcl_CreateObjCommand(interp,c->name,
92 @@ -3072,6 +3087,21 @@
93 Tcl_CreateCommand(interp,c->name,c->proc,
94 c->data,exp_deleteProc);
95 }
96 + else if (c->flags & EXP_REDEFINE) { /* unless the REDEFINE flag is present */
97 + Tcl_CmdInfo info;
98 +
99 + if (Tcl_GetCommandInfo(interp, c->name, &info)) {
100 + c->old_proc = info.proc;
101 + c->old_objProc = info.objProc;
102 + }
103 +
104 + if (c->objproc)
105 + Tcl_CreateObjCommand(interp,c->name,
106 + c->objproc,c->data,exp_deleteObjProc);
107 + else
108 + Tcl_CreateCommand(interp,c->name,c->proc,
109 + c->data,exp_deleteProc);
110 + }
111 if (!(c->name[0] == 'e' &&
112 c->name[1] == 'x' &&
113 c->name[2] == 'p')
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
117 @@ -297,6 +297,8 @@
118 Tcl_CmdProc *proc;
119 ClientData data;
120 int flags;
121 + Tcl_CmdProc *old_proc; /* these store the procedure for the old command, */
122 + Tcl_ObjCmdProc *old_objProc; /* if any */
123 };
124
125 EXTERN void exp_create_commands _ANSI_ARGS_((Tcl_Interp *,