From: Mikko Rasa Date: Sun, 4 Nov 2012 19:15:40 +0000 (+0200) Subject: Fix comment handling X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=6e0e2c78766de3ae57449866b74e111a2af893cf;p=libs%2Fdatafile.git Fix comment handling A comment start sequence inside another comment should not change the comment type. --- diff --git a/source/textparser.cpp b/source/textparser.cpp index 225425b..afa78b9 100644 --- a/source/textparser.cpp +++ b/source/textparser.cpp @@ -124,9 +124,9 @@ Token TextParser::parse_token() c = in.get(); int next = in.peek(); - if(c=='/' && next=='/') + if(c=='/' && next=='/' && !comment) comment = 1; - else if(c=='/' && next=='*') + else if(c=='/' && next=='*' && !comment) comment = 2; else if(c=='\n' && comment==1) comment = 0;