diff options
-rw-r--r-- | findutils/grep.c | 2 | ||||
-rwxr-xr-x | testsuite/grep.tests | 7 |
2 files changed, 8 insertions, 1 deletions
diff --git a/findutils/grep.c b/findutils/grep.c index a4033a40b..9d9da422c 100644 --- a/findutils/grep.c +++ b/findutils/grep.c | |||
@@ -404,7 +404,7 @@ static int grep_file(FILE *file) | |||
404 | #endif | 404 | #endif |
405 | ) { | 405 | ) { |
406 | if (option_mask32 & OPT_x) { | 406 | if (option_mask32 & OPT_x) { |
407 | found = (gl->matched_range.rm_so == 0 | 407 | found |= (gl->matched_range.rm_so == 0 |
408 | && match_at[gl->matched_range.rm_eo] == '\0'); | 408 | && match_at[gl->matched_range.rm_eo] == '\0'); |
409 | } else | 409 | } else |
410 | if (!(option_mask32 & OPT_w)) { | 410 | if (!(option_mask32 & OPT_w)) { |
diff --git a/testsuite/grep.tests b/testsuite/grep.tests index e57889790..26f8e69cf 100755 --- a/testsuite/grep.tests +++ b/testsuite/grep.tests | |||
@@ -177,6 +177,13 @@ testing "grep -w word match second word" \ | |||
177 | "bword,word\n""wordb,word\n""bwordb,word\n" \ | 177 | "bword,word\n""wordb,word\n""bwordb,word\n" \ |
178 | "" | 178 | "" |
179 | 179 | ||
180 | |||
181 | testing "grep -x -v -e EXP1 -e EXP2 finds nothing if either EXP matches" \ | ||
182 | "grep -x -v -e '.*aa.*' -e 'bb.*'; echo \$?" \ | ||
183 | "1\n" \ | ||
184 | "" \ | ||
185 | " aa bb cc\n" | ||
186 | |||
180 | # -r on symlink to dir should recurse into dir | 187 | # -r on symlink to dir should recurse into dir |
181 | mkdir -p grep.testdir/foo | 188 | mkdir -p grep.testdir/foo |
182 | echo bar > grep.testdir/foo/file | 189 | echo bar > grep.testdir/foo/file |