source: trunk/dports/devel/expect/files/expect-5.43.0-tcl_8.5.5_fix-1.diff @ 45861

Last change on this file since 45861 was 45861, checked in by markd@…, 9 years ago

Add a patch for Tcl 8.5.

File size: 3.5 KB
  • Dbg.c

    diff -Naur Dbg.c.orig Dbg.c
    old new  
    99*/
    1010
    1111#include <stdio.h>
    12 
     12#include "expect_cf.h"
    1313#include "tcldbgcf.h"
    1414#if 0
    1515/* tclInt.h drags in stdlib.  By claiming no-stdlib, force it to drag in */
  • exp_inter.c

    diff -Naur exp_inter.c.orig exp_inter.c
    old new  
    3636#include <ctype.h>
    3737
    3838#include "tcl.h"
     39#include "tclInt.h"
    3940#include "string.h"
    4041
    4142#include "exp_tty_in.h"
  • exp_command.c

    diff -Naur exp_command.c.orig exp_command.c
    old new  
    22652265        /*NOTREACHED*/
    22662266}
    22672267
     2268static struct exp_cmd_data cmd_data[];
     2269
    22682270/*ARGSUSED*/
    22692271static int
    22702272Exp_CloseObjCmd(clientData, interp, objc, objv)
     
    23112313        /* Historical note: we used "close"  long before there was a */
    23122314        /* Tcl builtin by the same name. */
    23132315
     2316        /* The code that registered this function as the handler for */
     2317        /* the "close" command stored away the old handler in the */
     2318        /* exp_cmd_data for the "close" command. */
     2319
     2320        struct exp_cmd_data *cmd_ptr;
    23142321        Tcl_CmdInfo info;
     2322
     2323        for(cmd_ptr = &cmd_data[0]; cmd_ptr->name; cmd_ptr++) {
     2324            if(strncmp(cmd_ptr->name, "close", 5) == 0)
     2325                break;
     2326        }
     2327
    23152328        Tcl_ResetResult(interp);
    23162329        if (0 == Tcl_GetCommandInfo(interp,"close",&info)) {
    23172330            info.clientData = 0;
    23182331        }
    2319         return(Tcl_CloseObjCmd(info.clientData,interp,objc_orig,objv_orig));
     2332        return(cmd_ptr->old_objProc(info.clientData,interp,objc_orig,objv_orig));
    23202333    }
    23212334
    23222335    if (chanName) {
     
    29612974    /* if successful (i.e., TCL_RETURN is returned) */
    29622975    /* modify the result, so that we will handle it specially */
    29632976
    2964     int result = Tcl_ReturnObjCmd(clientData,interp,objc,objv);
     2977    Tcl_CmdInfo info;
     2978    Tcl_GetCommandInfo(interp, "return", &info);
     2979
     2980    int result = info.objProc(clientData,interp,objc,objv);
    29652981    if (result == TCL_RETURN)
    29662982        result = EXP_TCL_RETURN;
    29672983    return result;
     
    30623078
    30633079        for (;c->name;c++) {
    30643080                /* if already defined, don't redefine */
    3065                 if ((c->flags & EXP_REDEFINE) ||
    3066                     !(Tcl_FindHashEntry(&globalNsPtr->cmdTable,c->name) ||
     3081                if (!(Tcl_FindHashEntry(&globalNsPtr->cmdTable,c->name) ||
    30673082                      Tcl_FindHashEntry(&currNsPtr->cmdTable,c->name))) {
    30683083                        if (c->objproc)
    30693084                                Tcl_CreateObjCommand(interp,c->name,
     
    30723087                                Tcl_CreateCommand(interp,c->name,c->proc,
    30733088                                                  c->data,exp_deleteProc);
    30743089                }
     3090                else if (c->flags & EXP_REDEFINE) { /* unless the REDEFINE flag is present */
     3091                        Tcl_CmdInfo info;
     3092
     3093                        if (Tcl_GetCommandInfo(interp, c->name, &info)) {
     3094                                c->old_proc     = info.proc;
     3095                                c->old_objProc  = info.objProc;
     3096                        }
     3097
     3098                        if (c->objproc)
     3099                                Tcl_CreateObjCommand(interp,c->name,
     3100                                                     c->objproc,c->data,exp_deleteObjProc);
     3101                        else
     3102                                Tcl_CreateCommand(interp,c->name,c->proc,
     3103                                                  c->data,exp_deleteProc);
     3104                }
    30753105                if (!(c->name[0] == 'e' &&
    30763106                      c->name[1] == 'x' &&
    30773107                      c->name[2] == 'p')
  • exp_command.h

    diff -Naur exp_command.h.orig exp_command.h
    old new  
    297297        Tcl_CmdProc     *proc;
    298298        ClientData      data;
    299299        int             flags;
     300        Tcl_CmdProc     *old_proc;     /* these store the procedure for the old command, */
     301        Tcl_ObjCmdProc  *old_objProc;  /* if any */
    300302};
    301303
    302304EXTERN void             exp_create_commands _ANSI_ARGS_((Tcl_Interp *,
Note: See TracBrowser for help on using the repository browser.