X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Ftinygettext%2Ftinygettext.cpp;h=e780ded4233140329822334b44c87b413a113c56;hb=86e5914510fc29f4decbb66a7d602872b6c8555e;hp=21fea977f284e15a4775a4d3fca4a1b0afce6939;hpb=aee6c4dede5a9c4fa0f7eb134fba61fef738a573;p=supertux.git diff --git a/src/tinygettext/tinygettext.cpp b/src/tinygettext/tinygettext.cpp index 21fea977f..e780ded42 100644 --- a/src/tinygettext/tinygettext.cpp +++ b/src/tinygettext/tinygettext.cpp @@ -619,15 +619,12 @@ public: if(c == EOF) return; - while(isspace(static_cast(c))) nextChar(); - - // Comments are whitespace too (remove if we ever parse comments) - if (c == '#') - { - do { - nextChar(); - } while(c != '\n' && c != EOF); + while(c == '#' || isspace(static_cast(c))) { + if(c == '#') { + while(c != '\n' && c != EOF) nextChar(); } + nextChar(); + } } inline bool expectToken(std::string type, Token wanted) { @@ -718,15 +715,14 @@ public: Token nextToken() { - if(c == EOF) - return TOKEN_EOF; - //Clear token contents tokenContent = ""; skipSpace(); - if(c != '"') + if(c == EOF) + return TOKEN_EOF; + else if(c != '"') { // Read a keyword do {