summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2016-08-18 23:12:10 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2016-08-18 23:12:57 -0700
commit954a3eb3d15fee91b5d78632c6f6a5ed5f93505f (patch)
tree78c99cf5349cb8c30832980e06c3e1bb0442cc8f
parent5b3da8d04b34f80e02c8d96bd739add0b05961a0 (diff)
downloadgrep-954a3eb3d15fee91b5d78632c6f6a5ed5f93505f.tar.gz
grep: tune list_files conversion to enum
* src/grep.c (grepdesc): Use a slightly more-efficient way to test list_files.
-rw-r--r--src/grep.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/grep.c b/src/grep.c
index cc46919d..f4d0444f 100644
--- a/src/grep.c
+++ b/src/grep.c
@@ -1853,8 +1853,7 @@ grepdesc (int desc, bool command_line)
}
status = !count;
- if ((list_files == LISTFILES_MATCHING && count > 0)
- || (list_files == LISTFILES_NONMATCHING && count == 0))
+ if (list_files == (status ? LISTFILES_NONMATCHING : LISTFILES_MATCHING))
{
print_filename ();
putchar_errno ('\n' & filename_mask);