summaryrefslogtreecommitdiff
path: root/builtin/remote.c
diff options
context:
space:
mode:
authorGary V. Vaughan <git@mlists.thewrittenword.com>2010-05-14 09:31:33 +0000
committerJunio C Hamano <gitster@pobox.com>2010-05-31 16:59:26 -0700
commit66dbfd55e38128db02eb340fcd89f54b734d4c6e (patch)
tree115937b86083814adcc97bc55424720e96da5f72 /builtin/remote.c
parentebef82776512f56eec4b6ac98b076369eb5a93fa (diff)
downloadgit-66dbfd55e38128db02eb340fcd89f54b734d4c6e.tar.gz
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/remote.c')
-rw-r--r--builtin/remote.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/builtin/remote.c b/builtin/remote.c
index 277765b864..23ece02aad 100644
--- a/builtin/remote.c
+++ b/builtin/remote.c
@@ -705,11 +705,14 @@ static int rm(int argc, const char **argv)
struct known_remotes known_remotes = { NULL, NULL };
struct string_list branches = { NULL, 0, 0, 1 };
struct string_list skipped = { NULL, 0, 0, 1 };
- struct branches_for_remote cb_data = {
- NULL, &branches, &skipped, &known_remotes
- };
+ struct branches_for_remote cb_data;
int i, result;
+ memset(&cb_data, 0, sizeof(cb_data));
+ cb_data.branches = &branches;
+ cb_data.skipped = &skipped;
+ cb_data.keep = &known_remotes;
+
if (argc != 2)
usage_with_options(builtin_remote_rm_usage, options);