X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Ftinygettext%2Ftinygettext.cpp;h=ffaaf710da3c97c1271039980d99abb2e8ccfb43;hb=5ee161985d711c1cbe18b51b6db0076e34ddf613;hp=d22ae2a6f41da4c9e6edb3047d2fe6e37e46cbfe;hpb=8de58c8f39896f7f5e287d46544ddd045f527824;p=supertux.git diff --git a/src/tinygettext/tinygettext.cpp b/src/tinygettext/tinygettext.cpp index d22ae2a6f..ffaaf710d 100644 --- a/src/tinygettext/tinygettext.cpp +++ b/src/tinygettext/tinygettext.cpp @@ -31,7 +31,6 @@ #include "tinygettext.hpp" #include "log.hpp" #include "physfs/physfs_stream.hpp" -#include "log.hpp" #include "findlocale.hpp" //#define TRANSLATION_DEBUG @@ -224,7 +223,7 @@ DictionaryManager::parseLocaleAliases() char c = ' '; while(in.good() && !in.eof()) { - while(isspace(c) && !in.eof()) + while(isspace(static_cast(c)) && !in.eof()) in.get(c); if(c == '#') { // skip comments @@ -234,14 +233,14 @@ DictionaryManager::parseLocaleAliases() } std::string alias; - while(!isspace(c) && !in.eof()) { + while(!isspace(static_cast(c)) && !in.eof()) { alias += c; in.get(c); } - while(isspace(c) && !in.eof()) + while(isspace(static_cast(c)) && !in.eof()) in.get(c); std::string language; - while(!isspace(c) && !in.eof()) { + while(!isspace(static_cast(c)) && !in.eof()) { language += c; in.get(c); } @@ -709,6 +708,9 @@ public: { state = SKIP_COMMENT; } + else if (c == '\n') + { + } else { // Read a new token @@ -716,7 +718,7 @@ public: do { // Read keyword token.keyword += c; - } while((c = getchar(in)) != EOF && !isspace(c)); + } while((c = getchar(in)) != EOF && !isspace(static_cast(c))); in.unget(); state = READ_CONTENT; @@ -730,12 +732,13 @@ public: // Found start of content state = READ_CONTENT_IN_STRING; break; - } else if (isspace(c)) { + } else if (isspace(static_cast(c))) { // skip } else { // Read something that may be a keyword in.unget(); state = READ_KEYWORD; add_token(token); + token = Token(); break; } } @@ -774,6 +777,7 @@ public: } } add_token(token); + token = Token(); } };