Stop wmlparser from crashing on empty files.

This commit is contained in:
Alexander van Gessel 2008-12-14 23:57:00 +01:00
parent 09e8a90d44
commit c2fb5a09f2

View file

@ -102,7 +102,8 @@ class Parser:
u = text.decode("latin1")
text = u
text = text.replace("\r\n", "\n").replace("\t", " ").replace("\r", "\n")
if text[-1] != "\n": text += "\n"
if text == "" or text[-1] != "\n":
text += "\n"
return text
def set_macro_not_found_callback(self, callback):