Skip to contentSkip to conversation

dir.c: remove the second declaration of "stk" in prep_exclude()

PATCH New Nguyễn Thái Ngọc Duy 1 participant 1 message Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dir.c: remove the second declaration of "stk" in prep_exclude()

This "stk" shadows the first declaration at the top. There's currently no bad effect. But let's avoid it.

---
 dir.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
dir.c +1 -1
index bd274a7..3f7a025 100644
@@ -826,9 +826,9 @@ static void prep_exclude(struct dir_struct *dir, const char *base, int baselen)
 	current = stk ? stk->baselen : -1;
 	strbuf_setlen(&dir->basebuf, current < 0 ? 0 : current);
 	while (current < baselen) {
-		struct exclude_stack *stk = xcalloc(1, sizeof(*stk));
 		const char *cp;
 
+		stk = xcalloc(1, sizeof(*stk));
 		if (current < 0) {
 			cp = base;
 			current = 0;
Signature · 1 line
2.1.0.rc0.78.gc0d8480