python/retrace: Trim null chars.
authorJosé Fonseca <jrfonseca@tungstengraphics.com>
Tue, 19 Aug 2008 17:25:38 +0000 (18:25 +0100)
committerJosé Fonseca <jrfonseca@tungstengraphics.com>
Tue, 19 Aug 2008 20:35:06 +0000 (21:35 +0100)
They are often left in memory mapped files, and are not part of the XML
accept chars anyway.

src/gallium/state_trackers/python/retrace/parser.py

index 9ee47f6e1924108011ed5cbeee8834e69ec8bd7b..d02fd7f741f3cc4919b87bbabca912afd4010451 100755 (executable)
@@ -101,6 +101,7 @@ class XmlTokenizer:
             self.index = 0
             data = self.fp.read(size)
             self.final = len(data) < size
+            data = data.rstrip('\0')
             try:
                 self.parser.Parse(data, self.final)
             except xml.parsers.expat.ExpatError, e: