From 8af647d7d47861a28e77fc55df6b7047585e84d8 Mon Sep 17 00:00:00 2001 From: Spoike Date: Sun, 27 Jul 2008 02:48:59 +0000 Subject: [PATCH] Blub\0's latest patch. This one fixes up for arguments. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3027 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/qclib/qcc_pr_lex.c | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/engine/qclib/qcc_pr_lex.c b/engine/qclib/qcc_pr_lex.c index 2123960f..e1795de0 100644 --- a/engine/qclib/qcc_pr_lex.c +++ b/engine/qclib/qcc_pr_lex.c @@ -2070,7 +2070,10 @@ int QCC_PR_CheakCompConst(void) *pr_file_p = '\0'; pr_file_p++; while(*pr_file_p == ' ' || *pr_file_p == '\t') + { pr_file_p++; + start++; + } // move back by one char because we move forward by one at the end of the loop pr_file_p--; if (param == MAXCONSTANTPARAMS) @@ -2078,9 +2081,10 @@ int QCC_PR_CheakCompConst(void) } else if (*pr_file_p == ')' ) plevel--; + // see that *pr_file_p = '\0' up there? Must ++ BEFORE checking for !*pr_file_p + pr_file_p++; if (!*pr_file_p) QCC_PR_ParseError(ERR_EOF, "EOF on macro call"); - pr_file_p++; } if (param < c->numparams) QCC_PR_ParseError(ERR_TOOFEWPARAMS, "Not enough macro parameters"); @@ -2101,7 +2105,19 @@ int QCC_PR_CheakCompConst(void) } buffer[p] = 0; - if (*pr_file_p == '#') //if you ask for #a##b you will be shot. use #a #b instead, or chain macros. + if(*pr_file_p == '\"') + { + do + { + buffer[p++] = *pr_file_p; + ++pr_file_p; + } while( (pr_file_p[-1] == '\\' || pr_file_p[0] != '\"') && *pr_file_p && *pr_file_p != '\n' ); + buffer[p++] = *pr_file_p; // copy the end-quote too + buffer[p] = 0; + ++pr_file_p; // and skip it + continue; + } + else if (*pr_file_p == '#') //if you ask for #a##b you will be shot. use #a #b instead, or chain macros. { if (pr_file_p[1] == '#') { //concatinate (srip out whitespace) @@ -3312,3 +3328,5 @@ QCC_type_t *QCC_PR_ParseType (int newtype) #endif + +