return true;
}
-int COM_ReadAndTokenizeLine(const char **text, char **argv, int maxargc, char *tokenbuf, int tokenbufsize)
+int COM_ReadAndTokenizeLine(const char **text, char **argv, int maxargc, char *tokenbuf, int tokenbufsize, const char *commentprefix)
{
- int argc;
+ int argc, commentprefixlength;
char *tokenbufend;
const char *l;
argc = 0;
tokenbufend = tokenbuf + tokenbufsize;
l = *text;
+ commentprefixlength = 0;
+ if (commentprefix)
+ commentprefixlength = strlen(commentprefix);
while (*l && *l != '\n')
{
if (*l > ' ')
{
+ if (commentprefixlength && !strncmp(l, commentprefix, commentprefixlength))
+ {
+ while (*l && *l != '\n')
+ l++;
+ break;
+ }
if (argc >= maxargc)
return -1;
argv[argc++] = tokenbuf;
void COM_ToUpperString (const char *in, char *out, size_t size_out);
int COM_StringBeginsWith(const char *s, const char *match);
-int COM_ReadAndTokenizeLine(const char **text, char **argv, int maxargc, char *tokenbuf, int tokenbufsize);
+int COM_ReadAndTokenizeLine(const char **text, char **argv, int maxargc, char *tokenbuf, int tokenbufsize, const char *commentprefix);
typedef struct stringlist_s
{