Rewrite dynamic structure initializations to runtime assignment
[gitweb.git] / builtin / commit.c
index c5ab683d5b66d5ad85f53d13d6df71e29cd9234d..eb06945ae3a0d681b21f33ace882cdcb5569514b 100644 (file)
@@ -717,7 +717,8 @@ static int prepare_to_commit(const char *index_file, const char *prefix,
 
        if (use_editor) {
                char index[PATH_MAX];
-               const char *env[2] = { index, NULL };
+               const char *env[2] = { NULL };
+               env[0] =  index;
                snprintf(index, sizeof(index), "GIT_INDEX_FILE=%s", index_file);
                if (launch_editor(git_path(commit_editmsg), NULL, env)) {
                        fprintf(stderr,