Fix "ignored application parameter" message for short options.

git-svn-id: https://svn.eduke32.com/eduke32@2589 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
helixhorned 2012-04-04 18:58:33 +00:00
parent b7df5ffa5f
commit b85d40ea63

View file

@ -8597,6 +8597,7 @@ static void G_CheckCommandLine(int32_t argc, const char **argv)
do do
{ {
const char *const oc = argv[i]; const char *const oc = argv[i];
int32_t shortopt = 0, ignored_short_opt = 0;
c = oc; c = oc;
@ -8606,6 +8607,8 @@ static void G_CheckCommandLine(int32_t argc, const char **argv)
#endif #endif
) )
{ {
shortopt = 0;
if (!Bstrcasecmp(c+1,"?") || !Bstrcasecmp(c+1,"help") || !Bstrcasecmp(c+1,"-help")) if (!Bstrcasecmp(c+1,"?") || !Bstrcasecmp(c+1,"help") || !Bstrcasecmp(c+1,"-help"))
{ {
G_ShowParameterHelp(); G_ShowParameterHelp();
@ -8900,6 +8903,8 @@ static void G_CheckCommandLine(int32_t argc, const char **argv)
#endif #endif
) )
{ {
shortopt = 1;
c++; c++;
switch (Btolower(*c)) switch (Btolower(*c))
{ {
@ -8932,8 +8937,8 @@ static void G_CheckCommandLine(int32_t argc, const char **argv)
} }
case 'g': case 'g':
c++; c++;
if (!*c) break; if (*c)
G_AddGroup(c); G_AddGroup(c);
break; break;
case 'h': case 'h':
c++; c++;
@ -8947,8 +8952,8 @@ static void G_CheckCommandLine(int32_t argc, const char **argv)
break; break;
case 'j': case 'j':
c++; c++;
if (!*c) break; if (*c)
G_AddPath(c); G_AddPath(c);
break; break;
case 'l': case 'l':
ud.warp_on = 1; ud.warp_on = 1;
@ -9088,10 +9093,15 @@ static void G_CheckCommandLine(int32_t argc, const char **argv)
if (!g_scriptDebug) if (!g_scriptDebug)
g_scriptDebug = 1; g_scriptDebug = 1;
break; break;
default:
ignored_short_opt = 1;
break;
} }
} }
else else
{ {
shortopt = 0;
k = Bstrrchr(c,'.'); k = Bstrrchr(c,'.');
if (k) if (k)
{ {
@ -9131,7 +9141,8 @@ static void G_CheckCommandLine(int32_t argc, const char **argv)
} }
} }
initprintf("Warning: ignored application parameter \"%s\".\n", oc); if (!shortopt || ignored_short_opt)
initprintf("Warning: ignored application parameter \"%s\".\n", oc);
i++; i++;
} }