@matheusbsbs / matheus-bagliano / commits / 3a2f2bb354
Fork 0

config.c: avoid shadowing global.

This is purely cosmetic, but avoid shadowing "FILE *config_file" global in git_config_set_multivar() function. Signed-off-by: Junio C Hamano <junkio@cox.net>

Junio C Hamano committed Nov 25, 2005 at 11:10 UTC 3a2f2bb354d920e3f1b7f4334d3656c77e9fb423
1 file changed +5 -5
config.c
+5 -5
@@ -398,7 +398,7 @@ int git_config_set_multivar(const char* key, const char* value,
398 int i;
399 struct stat st;
400 int fd;
401 - char* config_file = strdup(git_path("config"));
401 + char* config_filename = strdup(git_path("config"));
402 char* lock_file = strdup(git_path("config.lock"));
403 const char* last_dot = strrchr(key, '.');
404
@@ -444,7 +444,7 @@ int git_config_set_multivar(const char* key, const char* value,
444 /*
445 * If .git/config does not exist yet, write a minimal version.
446 */
447 - if (stat(config_file, &st)) {
447 + if (stat(config_filename, &st)) {
448 static const char contents[] =
449 "#\n"
450 "# This is the config file\n"
@@ -523,7 +523,7 @@ int git_config_set_multivar(const char* key, const char* value,
523 return 5;
524 }
525
526 - in_fd = open(config_file, O_RDONLY, 0666);
526 + in_fd = open(config_filename, O_RDONLY, 0666);
527 contents = mmap(NULL, st.st_size, PROT_READ,
528 MAP_PRIVATE, in_fd, 0);
529 close(in_fd);
@@ -564,12 +564,12 @@ int git_config_set_multivar(const char* key, const char* value,
564 st.st_size - copy_begin);
565
566 munmap(contents, st.st_size);
567 - unlink(config_file);
567 + unlink(config_filename);
568 }
569
570 close(fd);
571
572 - if (rename(lock_file, config_file) < 0) {
572 + if (rename(lock_file, config_filename) < 0) {
573 fprintf(stderr, "Could not rename the lock file?\n");
574 return 4;
575 }