From: Mathnerd314 Date: Wed, 21 Jan 2009 01:20:54 +0000 (+0000) Subject: Rewrite spacing logic to properly handle comments X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=38ea8c3ead1a5b679621363b01dfd54c7b42cf75;p=supertux.git Rewrite spacing logic to properly handle comments SVN-Revision: 5830 --- diff --git a/src/tinygettext/tinygettext.cpp b/src/tinygettext/tinygettext.cpp index 21fea977f..7ba2c6064 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) {