cat-file: do not die on --textconv without textconv filters
[gitweb.git] / grep.c
diff --git a/grep.c b/grep.c
index 4bd1b8b1dd67e4f5c2223536b435198ce67463ba..bb548cae69d1eece8832c97332a91daac5f8dceb 100644 (file)
--- 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);
        }