fixed brackets within quotes being interpreted

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6380 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
sireus
2011-04-27 21:43:37 +00:00
parent 528db72bf1
commit 7dc5dfcca7
+4 -2
View File
@@ -329,11 +329,13 @@ char *parseexp(const char *&p, int right) // parse any nested set of
{
int left = *p++;
const char *word = p;
bool quot = false;
for(int brak = 1; brak; )
{
int c = *p++;
if(c==left) brak++;
else if(c==right) brak--;
if(c==left && !quot) brak++;
else if(c=='"') quot = !quot;
else if(c==right && !quot) brak--;
else if(!c) { p--; conoutf("missing \"%c\"", right); return NULL; }
}
char *s = newstring(word, p-word-1);