git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] grep: remove tautological check
@ 2012-10-20 17:26 David Soria Parra
  2012-10-20 19:23 ` Peter Krefting
  2012-10-22 13:20 ` Peter Krefting
  0 siblings, 2 replies; 3+ messages in thread
From: David Soria Parra @ 2012-10-20 17:26 UTC (permalink / raw)
  To: git; +Cc: David Soria Parra

The enum grep_header_field is unsigned. Therefore the field part of the
grep_pat structure is unsigned and cannot be less then 0. We remove the
tautological check for p->field < 0.

Signed-off-by: David Soria Parra <dsp@php.net>
---
 grep.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/grep.c b/grep.c
index 4bd1b8b..db177ef 100644
--- a/grep.c
+++ b/grep.c
@@ -625,7 +625,7 @@ 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 (GREP_HEADER_FIELD_MAX <= p->field)
 			die("bug: unknown header field %d", p->field);
 		compile_regexp(p, opt);
 	}
-- 
1.8.0.rc3.332.g181c802

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-10-22 13:21 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-10-20 17:26 [PATCH] grep: remove tautological check David Soria Parra
2012-10-20 19:23 ` Peter Krefting
2012-10-22 13:20 ` Peter Krefting

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).