Transitively read alternatives
[git.git] / config.c
index 87fb220..61eacef 100644 (file)
--- a/config.c
+++ b/config.c
@@ -336,8 +336,10 @@ static int store_aux(const char* key, const char* value)
                        store.state = KEY_SEEN;
                        store.seen++;
                } else if (strrchr(key, '.') - key == store.baselen &&
-                             !strncmp(key, store.key, store.baselen))
+                             !strncmp(key, store.key, store.baselen)) {
                                        store.state = SECTION_SEEN;
+                                       store.offset[store.seen] = ftell(config_file);
+               }
        }
        return 0;
 }
@@ -514,6 +516,8 @@ int git_config_set_multivar(const char* key, const char* value,
                                fprintf(stderr, "Invalid pattern: %s\n",
                                        value_regex);
                                free(store.value_regex);
+                               close(fd);
+                               unlink(lock_file);
                                ret = 6;
                                goto out_free;
                        }