From 7dc5dfcca786c9cfeb3b214b56eddb67ce3e8888 Mon Sep 17 00:00:00 2001 From: sireus Date: Wed, 27 Apr 2011 21:43:37 +0000 Subject: [PATCH] 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 --- source/src/command.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/source/src/command.cpp b/source/src/command.cpp index 59f47d81..76ca06c8 100644 --- a/source/src/command.cpp +++ b/source/src/command.cpp @@ -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);