move toolchain get before argc

This commit is contained in:
nakst 2022-01-20 11:07:57 +00:00
parent 973d4a5da7
commit fe743fa478
1 changed files with 16 additions and 16 deletions

View File

@ -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) {