From fe743fa478fd36ce7b911ba604183b834b8645a9 Mon Sep 17 00:00:00 2001 From: nakst <> Date: Thu, 20 Jan 2022 11:07:57 +0000 Subject: [PATCH] move toolchain get before argc --- util/build.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/util/build.c b/util/build.c index ac98239..a2bea47 100644 --- a/util/build.c +++ b/util/build.c @@ -1947,22 +1947,6 @@ int main(int _argc, char **_argv) { SaveConfig(); - if (argc >= 2) { - char buffer[4096]; - buffer[0] = 0; - - for (int i = 1; i < argc; i++) { - if (strlen(argv[i]) + 1 > sizeof(buffer) - strlen(buffer)) break; - if (i > 1) strcat(buffer, " "); - strcat(buffer, argv[i]); - } - - DoCommand(buffer); - return 0; - } else { - interactiveMode = true; - } - const char *runFirstCommand = NULL; if (CallSystem("" TOOLCHAIN_PREFIX "-gcc --version > /dev/null 2>&1 ")) { @@ -1979,6 +1963,22 @@ int main(int _argc, char **_argv) { foundValidCrossCompiler = true; } + if (argc >= 2) { + char buffer[4096]; + buffer[0] = 0; + + for (int i = 1; i < argc; i++) { + if (strlen(argv[i]) + 1 > sizeof(buffer) - strlen(buffer)) break; + if (i > 1) strcat(buffer, " "); + strcat(buffer, argv[i]); + } + + DoCommand(buffer); + return 0; + } else { + interactiveMode = true; + } + SaveConfig(); if (runFirstCommand) {