diff options
Diffstat (limited to 'src/grep.c')
-rw-r--r-- | src/grep.c | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -2563,9 +2563,12 @@ main (int argc, char **argv) /* If fgrep in a multibyte locale, then use grep if either (1) case is ignored (where grep is typically faster), or - (2) the pattern has an encoding error (where fgrep might not work). */ - if (compile == Fcompile && MB_CUR_MAX > 1 - && (match_icase || contains_encoding_error (keys, keycc))) + (2) the pattern matches words (where grep is typically faster), or + (3) the pattern has an encoding error (where fgrep might not work). */ + if (compile == Fcompile + && (MB_CUR_MAX > 1 && (match_icase + || contains_encoding_error (keys, keycc))) + || (MB_CUR_MAX == 1 && match_words)) { size_t new_keycc; char *new_keys; |