remove ugly shadowing of loop indexes in subloops.
builtin-mv.c and git.c has a nested loop that is governed by a variable 'i', but they shadow it with another instance of 'i'. Signed-off-by: Pierre Habouzit <madcoder@debian.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
Pierre Habouzit committed
Aug 23, 2006 at 12:39 UTC
d828f6ddf8bc33f848688655b94c82791edfe0d7
2 files changed
+6
-6
builtin-mv.c
+3
-3
@@ -262,10 +262,10 @@ int cmd_mv(int argc, const char **argv, const char *prefix)
262
} else {
263
for (i = 0; i < changed.nr; i++) {
264
const char *path = changed.items[i].path;
265
- int i = cache_name_pos(path, strlen(path));
266
- struct cache_entry *ce = active_cache[i];
265
+ int j = cache_name_pos(path, strlen(path));
266
+ struct cache_entry *ce = active_cache[j];
267
268
- if (i < 0)
268
+ if (j < 0)
269
die ("Huh? Cache entry for %s unknown?", path);
270
refresh_cache_entry(ce, 0);
271
}
git.c
+3
-3
@@ -292,11 +292,11 @@ static void handle_internal_command(int argc, const char **argv, char **envp)
292
if (p->option & USE_PAGER)
293
setup_pager();
294
if (getenv("GIT_TRACE")) {
295
- int i;
295
+ int j;
296
fprintf(stderr, "trace: built-in: git");
297
- for (i = 0; i < argc; ++i) {
297
+ for (j = 0; j < argc; ++j) {
298
fputc(' ', stderr);
299
- sq_quote_print(stderr, argv[i]);
299
+ sq_quote_print(stderr, argv[j]);
300
}
301
putc('\n', stderr);
302
fflush(stderr);