← Commit list

0a2c793bd

Ian Wienand
Ian Wienand
2010-04-30
FAILED Duration: 28s

Subject

grep: fix -Fi

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

findutils/grep.c+4 -1
@@ -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;
testsuite/grep.tests+2 -0
@@ -75,6 +75,8 @@ testing "grep handles multiple regexps" "grep -e one -e two input ; echo \$?" \
"one\ntwo\n0\n" "one\ntwo\n" ""
testing "grep -F handles multiple expessions" "grep -F -e one -e two input ; echo \$?" \
"one\ntwo\n0\n" "one\ntwo\n" ""
+testing "grep -F handles -i" "grep -F -i foo input ; echo \$?" \
+ "FOO\n0\n" "FOO\n" ""
# -f file/-
testing "grep can read regexps from stdin" "grep -f - input ; echo \$?" \