path: root/convert.c
diff options
authorGary V. Vaughan <>2010-05-14 09:31:33 (GMT)
committerJunio C Hamano <>2010-05-31 23:59:26 (GMT)
commit66dbfd55e38128db02eb340fcd89f54b734d4c6e (patch)
tree115937b86083814adcc97bc55424720e96da5f72 /convert.c
parentebef82776512f56eec4b6ac98b076369eb5a93fa (diff)
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 <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'convert.c')
1 files changed, 3 insertions, 1 deletions
diff --git a/convert.c b/convert.c
index 4f8fcb7..3fea3e9 100644
--- a/convert.c
+++ b/convert.c
@@ -249,7 +249,9 @@ static int filter_buffer(int in, int out, void *data)
struct child_process child_process;
struct filter_params *params = (struct filter_params *)data;
int write_err, status;
- const char *argv[] = { params->cmd, NULL };
+ const char *argv[] = { NULL, NULL };
+ argv[0] = params->cmd;
memset(&child_process, 0, sizeof(child_process));
child_process.argv = argv;