projects
/
platform
/
upstream
/
coreutils.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b6ff24f
)
Merge latest change from FSF.
author
Jim Meyering
<jim@meyering.net>
Wed, 18 Oct 1995 14:31:14 +0000
(14:31 +0000)
committer
Jim Meyering
<jim@meyering.net>
Wed, 18 Oct 1995 14:31:14 +0000
(14:31 +0000)
lib/regex.c
patch
|
blob
|
history
diff --git
a/lib/regex.c
b/lib/regex.c
index
ca485a8
..
348bd36
100644
(file)
--- a/
lib/regex.c
+++ b/
lib/regex.c
@@
-3265,9
+3265,10
@@
re_search_2 (bufp, string1, size1, string2, size2, startpos, range, regs, stop)
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;