X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=config.c;h=992e9884079a1edd5e42a6481ef5c40ac27edfed;hb=c5ced64578a82b9d172aceb2f67c6fb9e639f6d9;hp=34584f62b40ef256d1d0f75e2ee16ed30b1c11fa;hpb=0dccc7dceef03e4231b24c9e126110b338e1c1e1;p=git.git diff --git a/config.c b/config.c index 34584f62..992e9884 100644 --- a/config.c +++ b/config.c @@ -458,12 +458,6 @@ int git_config_set_multivar(const char* key, const char* value, * If .git/config does not exist yet, write a minimal version. */ if (stat(config_filename, &st)) { - static const char contents[] = - "#\n" - "# This is the config file\n" - "#\n" - "\n"; - free(store.key); /* if nothing to unset, error out */ @@ -474,8 +468,6 @@ int git_config_set_multivar(const char* key, const char* value, } store.key = (char*)key; - - write(fd, contents, sizeof(contents)-1); store_write_section(fd, key); store_write_pair(fd, key, value); } else{ @@ -495,7 +487,7 @@ int git_config_set_multivar(const char* key, const char* value, store.value_regex = (regex_t*)malloc(sizeof(regex_t)); if (regcomp(store.value_regex, value_regex, REG_EXTENDED)) { - fprintf(stderr, "Invalid pattern: %s", + fprintf(stderr, "Invalid pattern: %s\n", value_regex); free(store.value_regex); return 6;