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

[PATCH 1/2] mailmap: fix bogus for() loop that happened to be safe by accident

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 8, 2007, 01:32 UTC
Message-ID
<1197077573-14945-1-git-send-email-gitster@pobox.com>

The empty loop pretended to have an empty statement as its body by a phony indentation, but in fact was slurping the next statement into it.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 mailmap.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/mailmap.c b/mailmap.c
index 8714167..f017255 100644
--- a/mailmap.c
+++ b/mailmap.c
@@ -42,9 +42,10 @@ int read_mailmap(struct path_list *map, const char *filename, char **repo_abbrev
 			continue;
 		if (right_bracket == left_bracket + 1)
 			continue;
-		for (end_of_name = left_bracket; end_of_name != buffer
-				&& isspace(end_of_name[-1]); end_of_name--)
-			/* keep on looking */
+		for (end_of_name = left_bracket;
+		     end_of_name != buffer && isspace(end_of_name[-1]);
+		     end_of_name--)
+			; /* keep on looking */
 		if (end_of_name == buffer)
 			continue;
 		name = xmalloc(end_of_name - buffer + 1);
-- 
1.5.3.7-2182-g108b
Next: Junio C Hamano
Message 1 of 4 in “mailmap: fix bogus for() loop that happened to be safe by accident”
  1. 1/2 mailmap: fix bogus for() loop that happened to be safe by accidentJunio C Hamano, Dec 8, 2007
  2. 2/2 shortlog: code restruturing and clean-upJunio C Hamano, Dec 8, 2007
  3. Wincent ColaiutaDec 8, 2007
  4. Alex RiesenDec 8, 2007

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.