expect/expect-fixes.patch

183 lines
5.3 KiB
Diff
Raw Normal View History

Index: Makefile.in
================================================================================
--- Dbg.c
+++ Dbg.c
@@ -545,7 +545,7 @@
ClientData clientData,
Tcl_Interp *interp,
int level,
- char *command,
+ CONST char *command,
Tcl_Command commandInfo,
int objc,
struct Tcl_Obj * CONST * objv));
@@ -559,7 +559,7 @@
int level; /* positive number if called by Tcl, -1 if */
/* called by Dbg_On in which case we don't */
/* know the level */
-char *command;
+CONST char *command;
Tcl_Command commandInfo; /* Unused */
int objc;
struct Tcl_Obj * CONST * objv;
--- Makefile.in
+++ Makefile.in
@@ -23,7 +23,7 @@
SETUID = @SETUID@
# SETUID = chmod u+s
-LIB_RUNTIME_DIR = $(INSTALL_ROOT)@libdir@
+LIB_RUNTIME_DIR = $(DESTDIR)@libdir@
# The following Expect scripts are not necessary to have installed as
# commands, but are very useful. Edit out what you don't want
@@ -238,10 +238,10 @@
$(INSTALL_DATA) $(srcdir)/$$i $(DESTDIR)$(includedir) ; \
done;
# install standalone scripts and their man pages, if requested
- @mkdir -p $(INSTALL_ROOT)$(prefix)/bin
+ @mkdir -p $(DESTDIR)$(prefix)/bin
-for i in $(SCRIPT_LIST) ; do \
if [ -f $$i ] ; then \
- $(INSTALL_PROGRAM) $$i $(INSTALL_ROOT)$(prefix)/bin/$$i ; \
+ $(INSTALL_PROGRAM) $$i $(DESTDIR)$(prefix)/bin/$$i ; \
rm -f $$i ; \
else true; fi ; \
done
@@ -256,14 +256,14 @@
@mkdir -p $(DESTDIR)$(mandir)/man3
@echo "Installing documentation in $(DESTDIR)$(mandir)"
# install Expectk man page if present
- $(INSTALL_DATA) $(srcdir)/expectk.man $(mandir)/man1/expectk.1 ; \
+ $(INSTALL_DATA) $(srcdir)/expectk.man $(DESTDIR)$(mandir)/man1/expectk.1 ; \
# install Expect man page
- $(INSTALL_DATA) $(srcdir)/expect.man $(mandir)/man1/expect.1
+ $(INSTALL_DATA) $(srcdir)/expect.man $(DESTDIR)$(mandir)/man1/expect.1
# install man page for Expect and Expectk libraries
- $(INSTALL_DATA) $(srcdir)/libexpect.man $(mandir)/man3/libexpect.3
+ $(INSTALL_DATA) $(srcdir)/libexpect.man $(DESTDIR)$(mandir)/man3/libexpect.3
-for i in $(SCRIPT_MANPAGE_LIST) ; do \
if [ -f $(srcdir)/example/$$i.man ] ; then \
- $(INSTALL_DATA) $(srcdir)/example/$$i.man $(mandir)/man1/$$i.1 ; \
+ $(INSTALL_DATA) $(srcdir)/example/$$i.man $(DESTDIR)$(mandir)/man1/$$i.1 ; \
else true; fi ; \
done
--- configure.in
+++ configure.in
@@ -448,7 +448,7 @@
*-*-irix*) stty_reads_stdout=0 ;;
*-*-sco3.2v[[45]]*) stty_reads_stdout=1 ;;
i[[3456]]86-*-sysv4.2MP) stty_reads_stdout=0 ;;
- i[[3456]]86-*-linux*) stty_reads_stdout=0 ;;
+ *-*-linux*) stty_reads_stdout=0 ;;
# Not sure about old convex but 5.2 definitely reads from stdout
c[[12]]-*-*) stty_reads_stdout=1 ;;
*-*-aix[[34]]*) stty_reads_stdout=0 ;;
@@ -471,8 +471,9 @@
# if we still don't know, test
if test x"${stty_reads_stdout}" = x"" ; then
- $STTY_BIN > /dev/null 2> /dev/null
- if test $? -ne 0 ; then
+ $STTY_BIN > /dev/null 2> /dev/null; a=$?
+ $STTY_BIN < /dev/tty > /dev/null 2> /dev/null; b=$?
+ if test $a -ne 0 -a $b -ne 0; then
stty_reads_stdout=1
else
stty_reads_stdout=0
--- exp_command.c
+++ exp_command.c
@@ -2940,12 +2940,13 @@
/* are marked sys_waited already */
if (!esPtr->sys_waited) {
if (nowait) {
+ Tcl_Pid pid = (Tcl_Pid)esPtr->pid;
/* should probably generate an error */
/* if SIGCHLD is trapped. */
/* pass to Tcl, so it can do wait */
/* in background */
- Tcl_DetachPids(1,(Tcl_Pid *)&esPtr->pid);
+ Tcl_DetachPids(1, &pid);
exp_wait_zero(&esPtr->wait);
} else {
while (1) {
@@ -3296,6 +3297,7 @@
} else {
strcpy (argv[0],Tcl_GetString (objv[0]));
}
+ command = Tcl_GetString (objv[0]);
signal(SIGINT, SIG_DFL);
signal(SIGQUIT, SIG_DFL);
@@ -3467,7 +3469,8 @@
if (!leaveopen) {
/* remove from Expect's memory in anticipation of passing to Tcl */
if (esPtr->pid != EXP_NOPID) {
- Tcl_DetachPids(1,(Tcl_Pid *)&esPtr->pid);
+ Tcl_Pid pid = (Tcl_Pid)esPtr->pid;
+ Tcl_DetachPids(1,&pid);
esPtr->pid = EXP_NOPID;
esPtr->sys_waited = esPtr->user_waited = TRUE;
}
--- exp_inter.c
+++ exp_inter.c
@@ -250,13 +250,13 @@
return(EXP_MATCH);
}
} else if (!km->re) {
- int slen, kslen;
+ int kslen;
Tcl_UniChar sch, ksch;
/* fixed string */
ks = Tcl_GetString(km->keys);
- for (s = start_search;; s += slen, ks += kslen) {
+ for (s = start_search;; s++, ks += kslen) {
/* if we hit the end of this map, must've matched! */
if (*ks == 0) {
*skip = start_search-string;
--- expect.c
+++ expect.c
@@ -355,6 +355,7 @@
ec->pat = 0;
ec->body = 0;
ec->transfer = TRUE;
+ ec->simple_start = 0;
ec->indices = FALSE;
ec->iread = FALSE;
ec->timestamp = FALSE;
--- testsuite/aclocal.m4
+++ testsuite/aclocal.m4
@@ -0,0 +1,10 @@
+#
+# Include the TEA standard macro set
+#
+
+builtin(include,../tclconfig/tcl.m4)
+builtin(include,../expect.m4)
+
+#
+# Add here whatever m4 macros you want to define for your package
+#
--- testsuite/configure.in
+++ testsuite/configure.in
@@ -1,8 +1,12 @@
dnl Process this file with autoconf to produce a configure script.
-AC_INIT(exp_test.c)
+AC_INIT([exp_test],[0.42])
-CY_AC_PATH_TCLCONFIG
-CY_AC_LOAD_TCLCONFIG
+TEA_INIT([3.5])
+
+AC_CONFIG_AUX_DIR(../tclconfig)
+
+TEA_PATH_TCLCONFIG
+TEA_LOAD_TCLCONFIG
CC=$TCL_CC
AC_PROG_CC