diff --git a/polymer/build/src/build.c b/polymer/build/src/build.c index e5bb43031..09c83d87f 100644 --- a/polymer/build/src/build.c +++ b/polymer/build/src/build.c @@ -242,10 +242,19 @@ static int osdcmd_vidmode(const osdfuncparm_t *parm) extern int startwin_run(void); extern char *defsfilename; // set in bstub.c + +char **grps = NULL; +char grpstoadd = 0; + +void buildaddgroup(const char *buffer) +{ + grps = (char**)realloc(grps, sizeof(char*)*(grpstoadd+1)); + grps[grpstoadd++] = strdup(buffer); +} + int app_main(int argc, char **argv) { - char ch, quitflag, cmdsetup = 0, grpstoadd = 0; - char **grps = NULL; + char ch, quitflag, cmdsetup = 0; long i, j, k; pathsearchmode = 1; // unrestrict findfrompath so that full access to the filesystem can be had @@ -270,8 +279,7 @@ int app_main(int argc, char **argv) if (!strcmp(argv[i], "-setup")) cmdsetup = 1; else if (!strcmp(argv[i], "-g") || !strcmp(argv[i], "-grp")) { i++; - grps = (char**)realloc(grps, sizeof(char*)*(grpstoadd+1)); - grps[grpstoadd++] = argv[i]; + buildaddgroup(argv[i]); } else if (!strcmp(argv[i], "-help") || !strcmp(argv[i], "--help") || !strcmp(argv[i], "-?")) { char *s = @@ -320,6 +328,7 @@ int app_main(int argc, char **argv) for (i=0;i i+1) @@ -4402,10 +4410,6 @@ static void checkcommandline(int argc,char **argv) c++; switch (*c) { - case '?': - comlinehelp(); - exit(0); - break; case 'h': case 'H': c++; @@ -4421,6 +4425,12 @@ static void checkcommandline(int argc,char **argv) if (!*c) break; addgamepath(c); break; + case 'g': + case 'G': + c++; + if (!*c) break; + buildaddgroup(c); + break; } } i++; @@ -6017,7 +6027,7 @@ static void FuncMenu(void) for (j=0;j i+1) { @@ -8589,10 +8596,6 @@ static void checkcommandline(int argc,char **argv) c++; switch (*c) { - case '?': - comlinehelp(); - exit(0); - break; case 'a': case 'A': ud.playerai = 1;