Multiple improvements, because this package is mess.
###############################################################################
name = expect
-version = 5.43
+version = 5.45
release = 1
+thisapp = %{name}%{version}
groups = Development/Languages
url = http://expect.nist.gov/
summary = A program-script interaction and testing utility.
description
- xpect is a tcl application for automating and testing \
- interactive applications such as telnet, ftp, passwd, fsck, \
- rlogin, tip, etc. Expect makes it easy for a script to \
+ expect is a tcl application for automating and testing
+ interactive applications such as telnet, ftp, passwd, fsck,
+ rlogin, tip, etc. Expect makes it easy for a script to
control another program and interact with it.
end
-source_dl =
-sources = %{thisapp}.0.tar.gz
+source_dl = http://downloads.sourceforge.net/project/expect/Expect/%{version}/
build
requires
autoconf
automake
- tcl
+ tcl-devel
end
- configure_options = \
- --mandir=/usr/share/man \
- --with-tcl=/usr/lib \
- --with-tclinclude=/usr/include/ \
- --with-x=no \
+ prepare_cmds
+ aclocal
+ autoconf
+
+ cd testsuite
+ autoconf -I..
+ end
+
+ configure_options += \
+ --mandir=%{mandir} \
+ --with-tcl=%{libdir} \
+ --with-tclinclude=%{includedir} \
--enable-shared
test
make test
end
- install
- make install INSTALL_ROOT=%{BUILDROOT}
-
+ install_cmds
# remove cryptdir/decryptdir, as Linux has no crypt command
rm -f %{BUILDROOT}/usr/bin/{cryptdir,decryptdir}
rm -f %{BUILDROOT}/usr/share/man1/{cryptdir,decryptdir}.1*
packages
package %{name}
+
+ package %{name}-devel
+ template DEVEL
end
package %{name}-debuginfo
-diff -up expect-5.43/example/mkpasswd.random expect-5.43/example/mkpasswd
---- expect-5.43/example/mkpasswd.random 2004-12-07 00:38:21.000000000 +0100
-+++ expect-5.43/example/mkpasswd 2008-09-25 12:27:19.000000000 +0200
+diff -up expect-5.44.1.15/example/mkpasswd.orig expect-5.44.1.15/example/mkpasswd
+--- expect-5.44.1.15/example/mkpasswd.orig 2010-03-08 16:01:05.518378075 +0100
++++ expect-5.44.1.15/example/mkpasswd 2010-03-08 16:01:27.408388162 +0100
@@ -92,7 +92,14 @@ proc insert {pvar char} {
}
proc rand {m} {
- expr {int($m*rand())}
-+ set device /dev/urandom ;# /dev/random can block
++ set device /dev/urandom ;# /dev/random can block
+ set fileId [open $device r]
+ binary scan [read $fileId 4] i1 number
+ set clipped [expr $number % $m]
+++ /dev/null
-diff -up expect-5.43/configure.in.lib-spec expect-5.43/configure.in
---- expect-5.43/configure.in.lib-spec 2005-02-08 02:45:06.000000000 +0100
-+++ expect-5.43/configure.in 2008-09-25 12:23:26.000000000 +0200
-@@ -1141,7 +1141,7 @@ if test $ac_cv_sys_long_file_names = no;
- fi
-
- EXP_BUILD_LIB_SPEC="-L`pwd` -lexpect${EXP_LIB_VERSION}${DBGX}"
--EXP_LIB_SPEC="-L\${INSTALL_ROOT}\${exec_prefix}/lib -lexpect${EXP_LIB_VERSION}${DBGX}"
-+EXP_LIB_SPEC="-L\${libdir}/../.. -lexpect${EXP_LIB_VERSION}${DBGX}"
- EXP_UNSHARED_LIB_FILE=libexpect${EXP_LIB_VERSION}${DBGX}.a
-
- # The TCL_SHARED_LIB_SUFFIX macro below relies on the DBGX macro,
+++ /dev/null
-diff -up expect-5.43/Makefile.in.libdir expect-5.43/Makefile.in
---- expect-5.43/Makefile.in.libdir 2004-05-07 20:10:30.000000000 +0200
-+++ expect-5.43/Makefile.in 2008-09-25 12:24:08.000000000 +0200
-@@ -317,7 +317,7 @@ EXP_AND_TK_LIBS = $(LDFLAGS) @EXP_AND_TK
- CFLAGS_INT = $(MH_CFLAGS) $(CPPFLAGS) $(XCFLAGS)
-
- LIB_INSTALL_DIR = $(tcl_libdir)
--LIB_RUNTIME_DIR = $(tcl_libdir)
-+LIB_RUNTIME_DIR = $(subst $(INSTALL_ROOT),,$(tcl_libdir))
- # I don't understand why Tcl splits these up, but it does. LIB_RUNTIME_DIR
- # can appear as part of the LD_SEARCH_FLAGS inherited by configure.
-
--- /dev/null
+diff -up expect-5.44.1.15/exp_log.c.orig expect-5.44.1.15/exp_log.c
+--- expect-5.44.1.15/exp_log.c.orig 2010-03-08 15:45:20.581378309 +0100
++++ expect-5.44.1.15/exp_log.c 2010-03-08 15:45:38.838398279 +0100
+@@ -374,7 +374,7 @@ expDiagChannelOpen(interp,filename)
+ Tcl_DStringAppend(&tsdPtr->diagFilename,filename,-1);
+ }
+
+- tsdPtr->diagChannel = Tcl_OpenFileChannel(interp,newfilename,"a",0777);
++ tsdPtr->diagChannel = Tcl_OpenFileChannel(interp,newfilename,"a",0666);
+ if (!tsdPtr->diagChannel) {
+ Tcl_DStringFree(&tsdPtr->diagFilename);
+ return TCL_ERROR;
+++ /dev/null
-diff -Nur expect-5.43_old/configure expect-5.43_new/configure
---- expect-5.43_old/configure 2010-03-10 10:11:41.000000000 +0100
-+++ expect-5.43_new/configure 2010-03-10 10:12:01.000000000 +0100
-@@ -9,7 +9,7 @@
-
- # Defaults:
- ac_help=
--ac_default_prefix=/usr/local
-+ac_default_prefix=/usr
- # Any additions from configure.in:
- ac_help="$ac_help
- --enable-threads build with threads (not supported)"
--- /dev/null
+diff -up expect5.45/configure.in.orig expect5.45/configure.in
+--- expect5.45/configure.in.orig 2011-01-18 16:58:14.860806442 +0100
++++ expect5.45/configure.in 2011-01-18 16:58:30.378753210 +0100
+@@ -977,6 +977,7 @@ AC_SUBST(EXP_CC_SEARCH_FLAGS)
+ AC_SUBST(SETUID)
+ AC_SUBST(SETPGRP_VOID)
+ AC_SUBST(DEFAULT_STTY_ARGS)
++AC_SUBST(TCL_VERSION)
+ # Expect uses these from tclConfig.sh to make the main executable
+ AC_SUBST(TCL_DL_LIBS)
+ AC_SUBST(TCL_CC_SEARCH_FLAGS)
+diff -up expect5.45/Makefile.in.orig expect5.45/Makefile.in
+--- expect5.45/Makefile.in.orig 2011-01-18 16:58:37.787723824 +0100
++++ expect5.45/Makefile.in 2011-01-18 17:05:10.697636907 +0100
+@@ -121,8 +121,8 @@ includedir = @includedir@
+ DESTDIR =
+
+ PKG_DIR = $(PACKAGE_NAME)$(PACKAGE_VERSION)
+-pkgdatadir = $(datadir)/$(PKG_DIR)
+-pkglibdir = $(libdir)/$(PKG_DIR)
++pkgdatadir = $(datadir)/tcl@TCL_VERSION@/$(PKG_DIR)
++pkglibdir = $(libdir)/tcl@TCL_VERSION@/$(PKG_DIR)
+ pkgincludedir = $(includedir)/$(PKG_DIR)
+
+ top_builddir = .
+@@ -263,7 +263,7 @@ install-doc: doc
+ else true; fi ; \
+ done
+
+-test: binaries libraries
++test: binaries libraries pkgIndex.tcl-test
+ $(TCLSH) `@CYGPATH@ $(srcdir)/tests/all.tcl` $(TESTFLAGS)
+
+ shell: binaries libraries
+@@ -331,6 +331,11 @@ pkgIndex.tcl:
+ pkgIndex.tcl-hand:
+ (echo 'if {![package vsatisfies [package provide Tcl] @TCL_VERSION@]} {return}' ; \
+ echo 'package ifneeded Expect $(PACKAGE_VERSION) \
++ [list load [file join $$dir .. .. $(PKG_LIB_FILE)]]'\
++ ) > pkgIndex.tcl
++
++pkgIndex.tcl-test:
++ (echo 'package ifneeded Expect $(PACKAGE_VERSION) \
+ [list load [file join $$dir $(PKG_LIB_FILE)]]'\
+ ) > pkgIndex.tcl
+
+++ /dev/null
-Submitted By: LFS Book <lfs-book@linuxfromscratch.org>
-Date: 2003-10-05
-Initial Package Version: 5.38
-Origin: Redhat RPM (Patch by HJ Lu)
-Description: NA
-diff -uNr expect-5.38.orig/exp_chan.c expect-5.38/exp_chan.c
---- expect-5.38.orig/exp_chan.c 2002-02-12 13:00:55.000000000 +1100
-+++ expect-5.38/exp_chan.c 2003-03-01 10:36:18.000000000 +1100
-@@ -519,6 +519,7 @@
- esPtr->buffer = Tcl_NewStringObj("",0);
- Tcl_IncrRefCount(esPtr->buffer);
- esPtr->umsize = exp_default_match_max;
-+ esPtr->umsize_changed = exp_default_match_max_changed;
- /* this will reallocate object with an appropriate sized buffer */
- expAdjust(esPtr);
-
-diff -uNr expect-5.38.orig/exp_command.h expect-5.38/exp_command.h
---- expect-5.38.orig/exp_command.h 2002-04-08 08:57:20.000000000 +1000
-+++ expect-5.38/exp_command.h 2003-03-01 10:36:18.000000000 +1100
-@@ -25,6 +25,7 @@
- EXTERN char * exp_get_var _ANSI_ARGS_((Tcl_Interp *,char *));
-
- EXTERN int exp_default_match_max;
-+EXTERN int exp_default_match_max_changed;
- EXTERN int exp_default_parity;
- EXTERN int exp_default_rm_nulls;
-
-@@ -97,6 +98,7 @@
- int msize; /* # of bytes that buffer can hold (max) */
- int umsize; /* # of bytes (min) that is guaranteed to match */
- /* this comes from match_max command */
-+ int umsize_changed; /* is umsize changed by user? */
- int printed; /* # of bytes written to stdout (if logging on) */
- /* but not actually returned via a match yet */
- int echoed; /* additional # of bytes (beyond "printed" above) */
-diff -uNr expect-5.38.orig/expect.c expect-5.38/expect.c
---- expect-5.38.orig/expect.c 2002-04-08 09:00:33.000000000 +1000
-+++ expect-5.38/expect.c 2003-03-01 10:36:18.000000000 +1100
-@@ -41,8 +41,17 @@
- #include "tcldbg.h"
- #endif
-
-+/* The initial length is 2000. We increment it by 2000. The maximum
-+ is 8MB (0x800000). */
-+#define EXP_MATCH_MAX 2000
-+#define EXP_MATCH_INC 2000
-+#define EXP_MATCH_STEP_LIMIT 0x700000
-+#define EXP_MATCH_LIMIT 0x800000
-+#define EXP_MATCH_LIMIT_QUOTE "0x800000"
-+
- /* initial length of strings that we can guarantee patterns can match */
--int exp_default_match_max = 2000;
-+int exp_default_match_max = EXP_MATCH_MAX;
-+int exp_default_match_max_changed = 0;
- #define INIT_EXPECT_TIMEOUT_LIT "10" /* seconds */
- #define INIT_EXPECT_TIMEOUT 10 /* seconds */
- int exp_default_parity = TRUE;
-@@ -1618,6 +1627,76 @@
- return newsize;
- }
-
-+/* returns # of bytes until we see a newline at the end or EOF. */
-+/*ARGSUSED*/
-+static int
-+expReadNewLine(interp,esPtr,save_flags) /* INTL */
-+Tcl_Interp *interp;
-+ExpState *esPtr;
-+int save_flags;
-+{
-+ int size;
-+ int exp_size;
-+ int full_size;
-+ int count;
-+ char *str;
-+
-+ count = 0;
-+ for (;;) {
-+ exp_size = expSizeGet(esPtr);
-+
-+ /* When we reach the limit, we will only read one char at a
-+ time. */
-+ if (esPtr->umsize >= EXP_MATCH_STEP_LIMIT)
-+ size = TCL_UTF_MAX;
-+ else
-+ size = exp_size;
-+
-+ if (exp_size + TCL_UTF_MAX >= esPtr->msize) {
-+ if (esPtr->umsize >= EXP_MATCH_LIMIT) {
-+ expDiagLogU("WARNING: interact buffer is full. probably your program\r\n");
-+ expDiagLogU("is not interactive or has a very long output line. The\r\n");
-+ expDiagLogU("current limit is " EXP_MATCH_LIMIT_QUOTE ".\r\n");
-+ expDiagLogU("Dumping first half of buffer in order to continue\r\n");
-+ expDiagLogU("Recommend you enlarge the buffer.\r\n");
-+ exp_buffer_shuffle(interp,esPtr,save_flags,EXPECT_OUT,"expect");
-+ return count;
-+ }
-+ else {
-+ esPtr->umsize += EXP_MATCH_INC;
-+ expAdjust(esPtr);
-+ }
-+ }
-+
-+ full_size = esPtr->msize - (size / TCL_UTF_MAX);
-+ size = Tcl_ReadChars(esPtr->channel,
-+ esPtr->buffer,
-+ full_size,
-+ 1 /* append */);
-+ if (size > 0) {
-+ count += size;
-+ /* We try again if there are more to read and we haven't
-+ seen a newline at the end. */
-+ if (size == full_size) {
-+ str = Tcl_GetStringFromObj(esPtr->buffer, &size);
-+ if (str[size - 1] != '\n')
-+ continue;
-+ }
-+ }
-+ else {
-+ /* It is even trickier. We got an error from read. We have
-+ to recover from it. Let's make sure the size of
-+ buffer is correct. It can be corrupted. */
-+ str = Tcl_GetString(esPtr->buffer);
-+ Tcl_SetObjLength(esPtr->buffer, strlen(str));
-+ }
-+
-+ break;
-+ }
-+
-+ return count;
-+}
-+
- /* returns # of bytes read or (non-positive) error of form EXP_XXX */
- /* returns 0 for end of file */
- /* If timeout is non-zero, set an alarm before doing the read, else assume */
-@@ -1632,6 +1711,8 @@
- {
- int cc = EXP_TIMEOUT;
- int size = expSizeGet(esPtr);
-+ int full_size;
-+ int count;
-
- if (size + TCL_UTF_MAX >= esPtr->msize)
- exp_buffer_shuffle(interp,esPtr,save_flags,EXPECT_OUT,"expect");
-@@ -1648,11 +1729,43 @@
- }
- #endif
-
--
-+ /* FIXME: If we ask less than what is available in the tcl buffer
-+ when tcl has seen EOF, we will throw away the remaining data
-+ since the next read will get EOF. Since expect is line-oriented,
-+ we exand our buffer to get EOF or the next newline at the end of
-+ the input buffer. I don't know if it is the right fix. H.J. */
-+ count = 0;
-+ full_size = esPtr->msize - (size / TCL_UTF_MAX);
- cc = Tcl_ReadChars(esPtr->channel,
-- esPtr->buffer,
-- esPtr->msize - (size / TCL_UTF_MAX),
-- 1 /* append */);
-+ esPtr->buffer,
-+ full_size,
-+ 1 /* append */);
-+ if (cc > 0) {
-+ count += cc;
-+ /* It gets very tricky. There are more to read. We will expand
-+ our buffer and get EOF or a newline at the end unless the
-+ buffer length has been changed. */
-+ if (cc == full_size) {
-+ char *str;
-+ str = Tcl_GetStringFromObj(esPtr->buffer, &size);
-+ if (str[size - 1] != '\n') {
-+ if (esPtr->umsize_changed) {
-+ char buf[20]; /* big enough for 64bit int in hex. */
-+ snprintf(buf,sizeof(buf),"0x%x", esPtr->umsize);
-+ expDiagLogU("WARNING: interact buffer is not large enough to hold\r\n");
-+ expDiagLogU("all output. probably your program is not interactive or\r\n");
-+ expDiagLogU("has a very long output line. The current limit is ");
-+ expDiagLogU(buf);
-+ expDiagLogU(".\r\n");
-+ }
-+ else {
-+ cc = expReadNewLine(interp,esPtr,save_flags);
-+ if (cc > 0)
-+ count += cc;
-+ }
-+ }
-+ }
-+ }
- i_read_errno = errno;
-
- #ifdef SIMPLE_EVENT
-@@ -1673,7 +1786,7 @@
- }
- }
- #endif
-- return cc;
-+ return count > 0 ? count : cc;
- }
-
- /*
-@@ -2746,8 +2859,14 @@
- return(TCL_ERROR);
- }
-
-- if (Default) exp_default_match_max = size;
-- else esPtr->umsize = size;
-+ if (Default) {
-+ exp_default_match_max = size;
-+ exp_default_match_max_changed = 1;
-+ }
-+ else {
-+ esPtr->umsize = size;
-+ esPtr->umsize_changed = 1;
-+ }
-
- return(TCL_OK);
- }
+++ /dev/null
-Submitted By: DJ Lucas <dj_AT_linuxfromscratch_DOT_org>
-Date: 2008-09-28
-Initial Package Version: 5.43
-Upstream status: Not Submitted
-Origin: LFS ticket 2126 (http://wiki.linuxfromscratch.org/lfs/ticket/2126)
- Bryan Kadzban <bryan@kadzban.is-a-geek.net>
-Description: Removes references to functions that Tcl 8.5 no longer exposes
- and correct other minor build problems WRT TCL-8.5.x.
-
-diff -Naur expect-5.43-orig/Dbg.c expect-5.43/Dbg.c
---- expect-5.43-orig/Dbg.c 2002-03-22 22:11:54.000000000 -0600
-+++ expect-5.43/Dbg.c 2008-08-24 01:30:15.000000000 -0500
-@@ -9,7 +9,7 @@
- */
-
- #include <stdio.h>
--
-+#include "expect_cf.h"
- #include "tcldbgcf.h"
- #if 0
- /* tclInt.h drags in stdlib. By claiming no-stdlib, force it to drag in */
-diff -Naur expect-5.43-orig/exp_inter.c expect-5.43/exp_inter.c
---- expect-5.43-orig/exp_inter.c 2004-08-17 21:03:00.000000000 -0500
-+++ expect-5.43/exp_inter.c 2008-08-24 01:28:59.000000000 -0500
-@@ -36,6 +36,7 @@
- #include <ctype.h>
-
- #include "tcl.h"
-+#include "tclInt.h"
- #include "string.h"
-
- #include "exp_tty_in.h"
-diff -Naur expect-5.43/exp_command.c expect-5.43-patched/exp_command.c
---- expect-5.43/exp_command.c 2004-08-20 13:18:01.000000000 -0400
-+++ expect-5.43-patched/exp_command.c 2008-01-12 11:42:45.000000000 -0500
-@@ -2265,6 +2265,8 @@
- /*NOTREACHED*/
- }
-
-+static struct exp_cmd_data cmd_data[];
-+
- /*ARGSUSED*/
- static int
- Exp_CloseObjCmd(clientData, interp, objc, objv)
-@@ -2311,12 +2313,23 @@
- /* Historical note: we used "close" long before there was a */
- /* Tcl builtin by the same name. */
-
-+ /* The code that registered this function as the handler for */
-+ /* the "close" command stored away the old handler in the */
-+ /* exp_cmd_data for the "close" command. */
-+
-+ struct exp_cmd_data *cmd_ptr;
- Tcl_CmdInfo info;
-+
-+ for(cmd_ptr = &cmd_data[0]; cmd_ptr->name; cmd_ptr++) {
-+ if(strncmp(cmd_ptr->name, "close", 5) == 0)
-+ break;
-+ }
-+
- Tcl_ResetResult(interp);
- if (0 == Tcl_GetCommandInfo(interp,"close",&info)) {
- info.clientData = 0;
- }
-- return(Tcl_CloseObjCmd(info.clientData,interp,objc_orig,objv_orig));
-+ return(cmd_ptr->old_objProc(info.clientData,interp,objc_orig,objv_orig));
- }
-
- if (chanName) {
-@@ -2961,7 +2974,10 @@
- /* if successful (i.e., TCL_RETURN is returned) */
- /* modify the result, so that we will handle it specially */
-
-- int result = Tcl_ReturnObjCmd(clientData,interp,objc,objv);
-+ Tcl_CmdInfo info;
-+ Tcl_GetCommandInfo(interp, "return", &info);
-+
-+ int result = info.objProc(clientData,interp,objc,objv);
- if (result == TCL_RETURN)
- result = EXP_TCL_RETURN;
- return result;
-@@ -3062,8 +3078,7 @@
-
- for (;c->name;c++) {
- /* if already defined, don't redefine */
-- if ((c->flags & EXP_REDEFINE) ||
-- !(Tcl_FindHashEntry(&globalNsPtr->cmdTable,c->name) ||
-+ if (!(Tcl_FindHashEntry(&globalNsPtr->cmdTable,c->name) ||
- Tcl_FindHashEntry(&currNsPtr->cmdTable,c->name))) {
- if (c->objproc)
- Tcl_CreateObjCommand(interp,c->name,
-@@ -3072,6 +3087,21 @@
- Tcl_CreateCommand(interp,c->name,c->proc,
- c->data,exp_deleteProc);
- }
-+ else if (c->flags & EXP_REDEFINE) { /* unless the REDEFINE flag is present */
-+ Tcl_CmdInfo info;
-+
-+ if (Tcl_GetCommandInfo(interp, c->name, &info)) {
-+ c->old_proc = info.proc;
-+ c->old_objProc = info.objProc;
-+ }
-+
-+ if (c->objproc)
-+ Tcl_CreateObjCommand(interp,c->name,
-+ c->objproc,c->data,exp_deleteObjProc);
-+ else
-+ Tcl_CreateCommand(interp,c->name,c->proc,
-+ c->data,exp_deleteProc);
-+ }
- if (!(c->name[0] == 'e' &&
- c->name[1] == 'x' &&
- c->name[2] == 'p')
-diff -Naur expect-5.43/exp_command.h expect-5.43-patched/exp_command.h
---- expect-5.43/exp_command.h 2008-01-12 11:44:11.000000000 -0500
-+++ expect-5.43-patched/exp_command.h 2008-01-12 11:26:05.000000000 -0500
-@@ -297,6 +297,8 @@
- Tcl_CmdProc *proc;
- ClientData data;
- int flags;
-+ Tcl_CmdProc *old_proc; /* these store the procedure for the old command, */
-+ Tcl_ObjCmdProc *old_objProc; /* if any */
- };
-
- EXTERN void exp_create_commands _ANSI_ARGS_((Tcl_Interp *,
--- /dev/null
+diff -up expect5.45/example/passmass.orig expect5.45/example/passmass
+--- expect5.45/example/passmass.orig 2011-07-27 16:09:31.013843393 +0200
++++ expect5.45/example/passmass 2011-07-27 16:10:55.667843578 +0200
+@@ -107,6 +107,10 @@ for {set i 0} {$i<$argc} {incr i} {
+ set login "ssh"
+ continue
+ } "-telnet" {
++ if {[file executable /usr/bin/telnet] == 0} {
++ send_user "It seems that telnet is not installed. Please install telnet in order to use the script with this option.\n"
++ exit 1
++ }
+ set login "telnet"
+ continue
+ } "-program" {
+diff -up expect5.45/example/weather.orig expect5.45/example/weather
+--- expect5.45/example/weather.orig 2011-07-27 15:49:57.878843862 +0200
++++ expect5.45/example/weather 2011-07-27 16:08:48.067843491 +0200
+@@ -33,6 +33,11 @@ set timeout 60
+
+ set env(TERM) vt100 ;# actual value doesn't matter, just has to be set
+
++if {[file executable /usr/bin/telnet] == 0} {
++ send_user "It seems that telnet is not installed. Please install telnet in order to use this script.\n"
++ exit 1
++}
++
+ spawn telnet rainmaker.wunderground.com 3000
+ while {1} {
+ expect timeout {
--- /dev/null
+diff -up expect5.45/expect.man.orig expect5.45/expect.man
+--- expect5.45/expect.man.orig 2011-09-06 13:15:57.081827720 +0200
++++ expect5.45/expect.man 2011-09-06 13:16:19.463826364 +0200
+@@ -173,7 +173,8 @@ way, use the
+ .B \-b
+ flag.
+ (When using Expectk, this option is specified as
+-.BR \-buffer .) Note that stdio-buffering may still take place however this shouldn't cause problems when reading from a fifo or stdin.
++.BR \-buffer .)
++Note that stdio-buffering may still take place however this shouldn't cause problems when reading from a fifo or stdin.
+ .PP
+ If the string "\-" is supplied as a filename, standard input is read instead.
+ (Use "./\-" to read from a file actually named "\-".)
--- /dev/null
+diff -up expect5.45/expect.c.orig expect5.45/expect.c
+--- expect5.45/expect.c.orig 2012-02-06 14:15:13.469490744 +0100
++++ expect5.45/expect.c 2012-02-06 14:16:23.596837896 +0100
+@@ -2363,7 +2363,12 @@ expMatchProcess(
+
+ /* "!e" means no case matched - transfer by default */
+ if (!e || e->transfer) {
+- int remainder = numchars-match;
++ int remainder;
++ if (match > numchars) {
++ match = numchars;
++ eo->matchlen = match;
++ }
++ remainder = numchars-match;
+ /* delete matched chars from input buffer */
+ esPtr->printed -= match;
+ if (numchars != 0) {
--- /dev/null
+diff -up expect5.45/example/mkpasswd.orig expect5.45/example/mkpasswd
+--- expect5.45/example/mkpasswd.orig 2011-03-16 13:23:23.125480017 +0100
++++ expect5.45/example/mkpasswd 2011-03-16 13:24:08.739353139 +0100
+@@ -202,7 +202,8 @@ if {[info exists user]} {
+ expect {
+ "assword*:" {
+ # some systems say "Password (again):"
+- send "$password\r"
++ send -- "$password\r"
++ # "--" because of passwords beginning with dash
+ exp_continue
+ }
+ }
--- /dev/null
+diff -up expect5.45/example/passmass.orig expect5.45/example/passmass
+--- expect5.45/example/passmass.orig 2011-09-06 13:04:41.439875491 +0200
++++ expect5.45/example/passmass 2011-09-06 13:04:54.663874571 +0200
+@@ -178,7 +178,7 @@ for {set i 0} {$i<$argc} {incr i} {
+ }
+
+ if ($su) {
+- send "su -\r"
++ send "/bin/su -\r"
+ expect -nocase "password:"
+ send "$password(old)\r"
+ expect "# "