]>
Commit | Line | Data |
---|---|---|
dade3e15 AM |
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( | |
5 | ||
6 | /* "!e" means no case matched - transfer by default */ | |
7 | if (!e || e->transfer) { | |
8 | - int remainder = numchars-match; | |
9 | + int remainder; | |
10 | + if (match > numchars) { | |
11 | + match = numchars; | |
12 | + eo->matchlen = match; | |
13 | + } | |
14 | + remainder = numchars-match; | |
15 | /* delete matched chars from input buffer */ | |
16 | esPtr->printed -= match; | |
17 | if (numchars != 0) { |