git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] Remove redundant line of code from grep.c

From
Angus Hammond <angusgh@gmail.com>
Date
May 6, 2012, 18:17 UTC
Message-ID
<1336328235-27387-1-git-send-email-angusgh@gmail.com>
Remove double initialisation of p in grep_expr.
Signed-off-by: Angus Hammond <angusgh@gmail.com>
---
 grep.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/grep.c b/grep.c
index 190139c..f8ffa46 100644
--- a/grep.c
+++ b/grep.c
@@ -318,7 +318,7 @@ static struct grep_expr *prep_header_patterns(struct grep_opt *opt)
 
 	if (!opt->header_list)
 		return NULL;
-	p = opt->header_list;
+
 	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.");
-- 
1.7.9.5
Message 1 of 1 in “Remove redundant line of code from grep.c”
  1. Remove redundant line of code from grep.cAngus Hammond, May 6, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.