From 07d6a7d7ee12b523d07461ddb6ebe5c9532a774f Mon Sep 17 00:00:00 2001 From: David Anderson Date: Fri, 15 Jun 2007 01:58:13 +0000 Subject: [PATCH] fixed bug amb395 --HG-- extra : convert_revision : svn%3A39bc706e-5318-0410-9160-8a85361fbb7c/trunk%40939 --- core/Translator.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/core/Translator.cpp b/core/Translator.cpp index 56b7345d..a9dcd8b6 100644 --- a/core/Translator.cpp +++ b/core/Translator.cpp @@ -195,7 +195,7 @@ SMCParseResult CPhraseFile::ReadSMC_NewSection(const char *name, bool opt_quotes SMCParseResult CPhraseFile::ReadSMC_KeyValue(const char *key, const char *value, bool key_quotes, bool value_quotes) { /* See if we are ignoring a phrase */ - if (!m_CurPhrase) + if (m_CurPhrase == -1) { return SMCParse_Continue; } @@ -227,6 +227,7 @@ SMCParseResult CPhraseFile::ReadSMC_KeyValue(const char *key, const char *value, ParseStates state = Parse_None; const char *old_value = value; + const char *last_value = value; while (*value != '\0') { if (state == Parse_None) @@ -248,7 +249,7 @@ SMCParseResult CPhraseFile::ReadSMC_KeyValue(const char *key, const char *value, if (*value == ':') { state = Parse_Format; - if (value - old_value >= 15) + if (value - last_value >= 15) { ParseWarning("Too many digits in format index on line %d, phrase will be ignored.", m_CurLine); m_CurPhrase = -1; @@ -269,6 +270,7 @@ SMCParseResult CPhraseFile::ReadSMC_KeyValue(const char *key, const char *value, if (*value == '}') { state = Parse_None; + last_value = value + 1; } } value++;