1 diff -up expect5.45/expect.c.orig expect5.45/expect.c
2 --- expect5.45/expect.c.orig 2012-02-06 14:15:13.469490744 +0100
3 +++ expect5.45/expect.c 2012-02-06 14:16:23.596837896 +0100
4 @@ -2363,7 +2363,12 @@ expMatchProcess(
6 /* "!e" means no case matched - transfer by default */
7 if (!e || e->transfer) {
8 - int remainder = numchars-match;
10 + if (match > numchars) {
12 + eo->matchlen = match;
14 + remainder = numchars-match;
15 /* delete matched chars from input buffer */
16 esPtr->printed -= match;