summaryrefslogtreecommitdiffstats
path: root/gnu
diff options
context:
space:
mode:
authortjr <tjr@FreeBSD.org>2005-10-25 09:18:50 +0000
committertjr <tjr@FreeBSD.org>2005-10-25 09:18:50 +0000
commit64e3944dbab2ffa6fa8e199e327151bda83382b4 (patch)
treec26f9006bfec04c23773d2a1bde57993ee5e2f80 /gnu
parent8bd59b71f57599ff5cd91b807994fbc8222cacf0 (diff)
downloadFreeBSD-src-64e3944dbab2ffa6fa8e199e327151bda83382b4.zip
FreeBSD-src-64e3944dbab2ffa6fa8e199e327151bda83382b4.tar.gz
Fix 'grep -Fw' for encodings other than UTF-8 (RH bug #161700).
PR: 87969 Obtained from: Fedora (Tim Waugh)
Diffstat (limited to 'gnu')
-rw-r--r--gnu/usr.bin/grep/search.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gnu/usr.bin/grep/search.c b/gnu/usr.bin/grep/search.c
index 1e57694..a195156 100644
--- a/gnu/usr.bin/grep/search.c
+++ b/gnu/usr.bin/grep/search.c
@@ -960,7 +960,7 @@ Fexecute (char const *buf, size_t size, size_t *match_size, int exact)
}
else
#endif /* MBS_SUPPORT */
- if (!WCHAR ((unsigned char) beg[-1]))
+ if (WCHAR ((unsigned char) beg[-1]))
goto next_char;
}
#ifdef MBS_SUPPORT
@@ -980,7 +980,7 @@ Fexecute (char const *buf, size_t size, size_t *match_size, int exact)
}
else
#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;
if (word_match)
{
OpenPOWER on IntegriCloud