Thread (1 message) 1 message, 1 author, 2016-06-15

Re: [PATCH] rm: do not set a variable twice without intermediate reading.

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:58:14

Stefan Beller [off-list ref] writes:
On 07/23/2013 08:32 PM, Junio C Hamano wrote:
quoted
Interesting. This is ancient and dates back to 7612a1ef (git-rm:
honor -n flag., 2006-06-08).
Originally it comes from d9b814cc97 (by Linus), which introduced:
+	seen = NULL;
+	if (pathspec) {
+		for (i = 0; pathspec[i] ; i++)
+			/* nothing */;
+		seen = xmalloc(i);
+		memset(seen, 0, i);
+	}

Then in 7612a1efdb0c the second seen assignment was made unconditional.
That is why I blamed the bug to 7612a1ef.  Before that, without pathspec,
directory traversal function were told not to report which ones were
seen and which ones were not by passing seen=NULL.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help