summaryrefslogtreecommitdiff
path: root/grep.c
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2013-03-25 14:00:54 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2013-03-25 14:00:54 -0700
commitedb99f95f54e9aea8ff4a93a6609a290e0871161 (patch)
tree9dbf64199e1d0f5ef0089ad861d7faceef990ef2 /grep.c
parentMerge branch 'pw/p4-symlinked-root' (diff)
parentfix clang -Wtautological-compare with unsigned enum (diff)
downloadtgif-edb99f95f54e9aea8ff4a93a6609a290e0871161.tar.xz
Merge branch 'jk/suppress-clang-warning'
* jk/suppress-clang-warning: fix clang -Wtautological-compare with unsigned enum
Diffstat (limited to 'grep.c')
-rw-r--r--grep.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/grep.c b/grep.c
index 4bd1b8b1dd..bb548cae69 100644
--- a/grep.c
+++ b/grep.c
@@ -625,7 +625,8 @@ static struct grep_expr *prep_header_patterns(struct grep_opt *opt)
for (p = opt->header_list; p; p = p->next) {
if (p->token != GREP_PATTERN_HEAD)
die("bug: a non-header pattern in grep header list.");
- if (p->field < 0 || GREP_HEADER_FIELD_MAX <= p->field)
+ if (p->field < GREP_HEADER_FIELD_MIN ||
+ GREP_HEADER_FIELD_MAX <= p->field)
die("bug: unknown header field %d", p->field);
compile_regexp(p, opt);
}