aboutsummaryrefslogtreecommitdiff
path: root/findutils/grep.c
diff options
context:
space:
mode:
authorIan Wienand <ianw@vmware.com>2010-04-30 09:32:10 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2010-04-30 09:32:10 +0200
commit0a2c793bd61540629d5686adb5afd2ada19d624f (patch)
treea40bb43c93cb08dddbe91363d3ae3a8ac63603f3 /findutils/grep.c
parentd2844fcb6862c080177aaf314cc98d03e65b05ac (diff)
downloadbusybox-0a2c793bd61540629d5686adb5afd2ada19d624f.tar.gz
grep: fix -Fi
function old new delta grep_file 1151 1169 +18 Signed-off-by: Ian Wienand <ianw@vmware.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'findutils/grep.c')
-rw-r--r--findutils/grep.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/findutils/grep.c b/findutils/grep.c
index 40caef423..0f1c11abb 100644
--- a/findutils/grep.c
+++ b/findutils/grep.c
@@ -254,7 +254,10 @@ static int grep_file(FILE *file)
while (pattern_ptr) {
gl = (grep_list_data_t *)pattern_ptr->data;
if (FGREP_FLAG) {
- found |= (strstr(line, gl->pattern) != NULL);
+ found |= (((option_mask32 & OPT_i)
+ ? strcasestr(line, gl->pattern)
+ : strstr(line, gl->pattern)
+ ) != NULL);
} else {
if (!(gl->flg_mem_alocated_compiled & COMPILED)) {
gl->flg_mem_alocated_compiled |= COMPILED;