Mercurial > hg > octave-nkf > gnulib-hg
changeset 497:68b8d9f8bf1a
Merge latest change from FSF.
author | Jim Meyering <jim@meyering.net> |
---|---|
date | Wed, 18 Oct 1995 14:31:14 +0000 |
parents | 39f6e38131a6 |
children | 89a4657bb64a |
files | lib/regex.c |
diffstat | 1 files changed, 4 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/lib/regex.c +++ b/lib/regex.c @@ -3265,9 +3265,10 @@ return -1; /* Fix up RANGE if it might eventually take us outside - the virtual concatenation of STRING1 and STRING2. */ - if (endpos < -1) - range = -1 - startpos; + the virtual concatenation of STRING1 and STRING2. + Make sure we won't move STARTPOS below 0 or above TOTAL_SIZE. */ + if (endpos < 0) + range = 0 - startpos; else if (endpos > total_size) range = total_size - startpos;