[Scummvm-cvs-logs] SF.net SVN: scummvm:[38209] scummvm/branches/branch-0-13-0/common/xmlparser .h

vinterstum at users.sourceforge.net vinterstum at users.sourceforge.net
Sun Feb 15 10:56:47 CET 2009


Revision: 38209
          http://scummvm.svn.sourceforge.net/scummvm/?rev=38209&view=rev
Author:   vinterstum
Date:     2009-02-15 09:56:47 +0000 (Sun, 15 Feb 2009)

Log Message:
-----------
Fixed XML comment parsing (got confused by single hyphens inside comment bodies)

Modified Paths:
--------------
    scummvm/branches/branch-0-13-0/common/xmlparser.h

Modified: scummvm/branches/branch-0-13-0/common/xmlparser.h
===================================================================
--- scummvm/branches/branch-0-13-0/common/xmlparser.h	2009-02-15 09:56:04 UTC (rev 38208)
+++ scummvm/branches/branch-0-13-0/common/xmlparser.h	2009-02-15 09:56:47 UTC (rev 38209)
@@ -332,16 +332,17 @@
 				return parserError("Malformed comment syntax.");
 
 			_char = _stream->readByte();
-			bool dash = false;
 
 			while (_char) {
 				if (_char == '-') {
-					if (dash && _stream->readByte() == '>') {
+					if (_stream->readByte() == '-') {
+
+						if (_stream->readByte() != '>')
+							return parserError("Malformed comment (double-hyphen inside comment body).");
+
 						_char = _stream->readByte();
 						return true;
 					}
-
-					dash = !dash;
 				}
 
 				_char = _stream->readByte();


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list