summaryrefslogtreecommitdiff
path: root/src/m_argv.c
diff options
context:
space:
mode:
authorSimon Howard2010-12-18 23:55:07 +0000
committerSimon Howard2010-12-18 23:55:07 +0000
commit463bcf013ce355398974953508d232ac88a6b2d6 (patch)
tree8f21093469f64e1d147bf22adc4acf6ad84b0310 /src/m_argv.c
parent1ef81eb5f7c336972fe56f15285f389cafdc96f5 (diff)
downloadchocolate-doom-463bcf013ce355398974953508d232ac88a6b2d6.tar.gz
chocolate-doom-463bcf013ce355398974953508d232ac88a6b2d6.tar.bz2
chocolate-doom-463bcf013ce355398974953508d232ac88a6b2d6.zip
Add a M_CheckParmWithArgs function, that behaves like M_CheckParm but
also checks that extra options were provided on the command line (thanks Sander van Dijk). Subversion-branch: /trunk/chocolate-doom Subversion-revision: 2223
Diffstat (limited to 'src/m_argv.c')
-rw-r--r--src/m_argv.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/m_argv.c b/src/m_argv.c
index 99295c6d..4d321bbc 100644
--- a/src/m_argv.c
+++ b/src/m_argv.c
@@ -47,19 +47,24 @@ char** myargv;
// or 0 if not present
//
-int M_CheckParm (char *check)
+int M_CheckParmWithArgs(char *check, int num_args)
{
- int i;
+ int i;
- for (i = 1;i<myargc;i++)
+ for (i = 1; i < myargc - num_args; i++)
{
- if ( !strcasecmp(check, myargv[i]) )
+ if (!strcasecmp(check, myargv[i]))
return i;
}
return 0;
}
+int M_CheckParm(char *check)
+{
+ return M_CheckParmWithArgs(check, 0);
+}
+
#define MAXARGVS 100
static void LoadResponseFile(int argv_index)