Fix 'grep -Fw' for encodings other than UTF-8 (RH bug #161700).

PR:		87969
Obtained from:	Fedora (Tim Waugh)
This commit is contained in:
Tim J. Robbins 2005-10-25 09:18:50 +00:00
parent d24864f785
commit ebeecabae3

View File

@ -960,7 +960,7 @@ Fexecute (char const *buf, size_t size, size_t *match_size, int exact)
} }
else else
#endif /* MBS_SUPPORT */ #endif /* MBS_SUPPORT */
if (!WCHAR ((unsigned char) beg[-1])) if (WCHAR ((unsigned char) beg[-1]))
goto next_char; goto next_char;
} }
#ifdef MBS_SUPPORT #ifdef MBS_SUPPORT
@ -980,7 +980,7 @@ Fexecute (char const *buf, size_t size, size_t *match_size, int exact)
} }
else else
#endif /* MBS_SUPPORT */ #endif /* MBS_SUPPORT */
if (beg + len >= buf + size && !WCHAR ((unsigned char) beg[len])) if (beg + len >= buf + size || !WCHAR ((unsigned char) beg[len]))
word_match = 1; word_match = 1;
if (word_match) if (word_match)
{ {