# HG changeset patch # User Jim Meyering # Date 992227694 0 # Node ID 31b6db41bfc5348b24f910021e8db421b0e8b508 # Parent a2faa604f96b3312ec5f8c2dd6bb54c469287772 Update from GNU libc. diff --git a/lib/regex.c b/lib/regex.c --- a/lib/regex.c +++ b/lib/regex.c @@ -5594,6 +5594,12 @@ 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 @@ } 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 @@ 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;