mirror of
https://github.com/DarkPlacesEngine/gmqcc.git
synced 2024-11-27 22:22:17 +00:00
fixup qcvm parameter handling, now progs.dat can be specified anywhere not just at the end
This commit is contained in:
parent
4f873e1d9d
commit
2531a3695f
1 changed files with 4 additions and 11 deletions
15
exec.c
15
exec.c
|
@ -1001,7 +1001,7 @@ int main(int argc, char **argv)
|
|||
|
||||
--argc;
|
||||
++argv;
|
||||
if (argc < 3) {
|
||||
if (argc < 2) {
|
||||
usage();
|
||||
exit(1);
|
||||
}
|
||||
|
@ -1028,27 +1028,20 @@ int main(int argc, char **argv)
|
|||
}
|
||||
else
|
||||
{
|
||||
printf("unknown parameter: %s\n", argv[1]);
|
||||
usage();
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
if (argc > 2) {
|
||||
usage();
|
||||
exit(1);
|
||||
}
|
||||
if (argc > 1) {
|
||||
if (progsfile) {
|
||||
printf("only 1 program file may be specified\n");
|
||||
usage();
|
||||
exit(1);
|
||||
}
|
||||
if (argc == 2 && !progsfile) {
|
||||
progsfile = argv[1];
|
||||
--argc;
|
||||
++argv;
|
||||
}
|
||||
|
||||
if (!progsfile) {
|
||||
printf("must specify a program to execute\n");
|
||||
usage();
|
||||
exit(1);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue