diff options
author | Nicola Mettifogo | 2007-07-08 13:39:23 +0000 |
---|---|---|
committer | Nicola Mettifogo | 2007-07-08 13:39:23 +0000 |
commit | 3036c37dd817545b4571f01625954c9c74c635ae (patch) | |
tree | 4506a82352996e532ffa36994b92c0fe90e92c36 /engines/parallaction/parser.cpp | |
parent | 925f75636951b9697a2c8f97d4c93fb1510fd617 (diff) | |
download | scummvm-rg350-3036c37dd817545b4571f01625954c9c74c635ae.tar.gz scummvm-rg350-3036c37dd817545b4571f01625954c9c74c635ae.tar.bz2 scummvm-rg350-3036c37dd817545b4571f01625954c9c74c635ae.zip |
Yet another fix for broken parsing/displaying of strings. Now quotes are properly considered when they are needed, and ignored when they aren't.
svn-id: r27967
Diffstat (limited to 'engines/parallaction/parser.cpp')
-rw-r--r-- | engines/parallaction/parser.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/engines/parallaction/parser.cpp b/engines/parallaction/parser.cpp index 6fd21b3099..44aae6c1cc 100644 --- a/engines/parallaction/parser.cpp +++ b/engines/parallaction/parser.cpp @@ -127,7 +127,7 @@ void clearTokens() { // // The routine returns the unparsed portion of the input string 's'. // -char *parseNextToken(char *s, char *tok, uint16 count, const char *brk) { +char *parseNextToken(char *s, char *tok, uint16 count, const char *brk, bool ignoreQuotes) { enum STATES { NORMAL, QUOTED }; @@ -150,8 +150,13 @@ char *parseNextToken(char *s, char *tok, uint16 count, const char *brk) { } if (*s == '"') { - state = QUOTED; - s++; + if (ignoreQuotes) { + *tok++ = *s++; + count--; + } else { + state = QUOTED; + s++; + } } else { *tok++ = *s++; count--; |