Skip to content

Commit

Permalink
remove ugly shadowing of loop indexes in subloops.
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
  • Loading branch information
MadCoder authored and Junio C Hamano committed Aug 24, 2006
1 parent b5bf7cd commit d828f6d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions builtin-mv.c
Original file line number Diff line number Diff line change
Expand Up @@ -262,10 +262,10 @@ int cmd_mv(int argc, const char **argv, const char *prefix)
} else {
for (i = 0; i < changed.nr; i++) {
const char *path = changed.items[i].path;
int i = cache_name_pos(path, strlen(path));
struct cache_entry *ce = active_cache[i];
int j = cache_name_pos(path, strlen(path));
struct cache_entry *ce = active_cache[j];

if (i < 0)
if (j < 0)
die ("Huh? Cache entry for %s unknown?", path);
refresh_cache_entry(ce, 0);
}
Expand Down
6 changes: 3 additions & 3 deletions git.c
Original file line number Diff line number Diff line change
Expand Up @@ -292,11 +292,11 @@ static void handle_internal_command(int argc, const char **argv, char **envp)
if (p->option & USE_PAGER)
setup_pager();
if (getenv("GIT_TRACE")) {
int i;
int j;
fprintf(stderr, "trace: built-in: git");
for (i = 0; i < argc; ++i) {
for (j = 0; j < argc; ++j) {
fputc(' ', stderr);
sq_quote_print(stderr, argv[i]);
sq_quote_print(stderr, argv[j]);
}
putc('\n', stderr);
fflush(stderr);
Expand Down

0 comments on commit d828f6d

Please sign in to comment.