summaryrefslogtreecommitdiff
path: root/builtin/commit.c
diff options
context:
space:
mode:
authorLibravatar Gary V. Vaughan <git@mlists.thewrittenword.com>2010-05-14 09:31:33 +0000
committerLibravatar Junio C Hamano <gitster@pobox.com>2010-05-31 16:59:26 -0700
commit66dbfd55e38128db02eb340fcd89f54b734d4c6e (patch)
tree115937b86083814adcc97bc55424720e96da5f72 /builtin/commit.c
parentMakefile: pass CPPFLAGS through to fllow customization (diff)
downloadtgif-66dbfd55e38128db02eb340fcd89f54b734d4c6e.tar.xz
Rewrite dynamic structure initializations to runtime assignment
Unfortunately, there are still plenty of production systems with vendor compilers that choke unless all compound declarations can be determined statically at compile time, for example hpux10.20 (I can provide a comprehensive list of our supported platforms that exhibit this problem if necessary). This patch simply breaks apart any compound declarations with dynamic initialisation expressions, and moves the initialisation until after the last declaration in the same block, in all the places necessary to have the offending compilers accept the code. Signed-off-by: Gary V. Vaughan <gary@thewrittenword.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/commit.c')
-rw-r--r--builtin/commit.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/builtin/commit.c b/builtin/commit.c
index c5ab683d5b..eb06945ae3 100644
--- a/builtin/commit.c
+++ b/builtin/commit.c
@@ -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,