summaryrefslogtreecommitdiff
path: root/lib/regex.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2001-06-11 02:48:14 +0000
committerJim Meyering <jim@meyering.net>2001-06-11 02:48:14 +0000
commit88a10b132bc4307f4ec79819d09eb0171631bb11 (patch)
tree1d20799d8db75e8c02c5dd34bce37f2036a81c40 /lib/regex.c
parent1be4401ecb038489716e08748220f339fc6afded (diff)
downloadcoreutils-88a10b132bc4307f4ec79819d09eb0171631bb11.tar.xz
Update from GNU libc.
Diffstat (limited to 'lib/regex.c')
-rw-r--r--lib/regex.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/regex.c b/lib/regex.c
index 22c4ddcc7..c0ded3905 100644
--- a/lib/regex.c
+++ b/lib/regex.c
@@ -5594,6 +5594,12 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
size2 = size1;
string1 = 0;
size1 = 0;
+#ifdef MBS_SUPPORT
+ mbs_offset2 = mbs_offset1;
+ csize2 = csize1;
+ mbs_offset1 = NULL;
+ csize1 = 0;
+#endif
}
end1 = string1 + size1;
end2 = string2 + size2;
@@ -5608,6 +5614,8 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
}
else
{
+ if (stop > csize1 + csize2)
+ stop = csize1 + csize2;
end_match_1 = end1;
mcnt = count_mbs_length(mbs_offset2, stop-csize1);
end_match_2 = string2 + mcnt;
@@ -7085,14 +7093,15 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop)
case wordbeg:
DEBUG_PRINT1 ("EXECUTING wordbeg.\n");
- if (WORDCHAR_P (d) && (AT_STRINGS_BEG (d) || !WORDCHAR_P (d - 1)))
+ if (!AT_STRINGS_END (d) && WORDCHAR_P (d)
+ && (AT_STRINGS_BEG (d) || !WORDCHAR_P (d - 1)))
break;
goto fail;
case wordend:
DEBUG_PRINT1 ("EXECUTING wordend.\n");
if (!AT_STRINGS_BEG (d) && WORDCHAR_P (d - 1)
- && (!WORDCHAR_P (d) || AT_STRINGS_END (d)))
+ && (AT_STRINGS_END (d) || !WORDCHAR_P (d)))
break;
goto fail;