2013-06-22 | Paul Boddie | raw files shortlog changelog graph | Fixed infinite loop caused by carriage return at end of input. | |
vContent.py (file) |
1.1 --- a/vContent.py Sat Jun 15 02:30:04 2013 +0200 1.2 +++ b/vContent.py Sat Jun 22 02:03:20 2013 +0200 1.3 @@ -104,7 +104,10 @@ 1.4 # Sanity check for broken lines (\r instead of \r\n or \n). 1.5 line = self.f.readline() 1.6 while line.endswith("\r") and not self.non_standard_newline: 1.7 - line += self.f.readline() 1.8 + s = self.f.readline() 1.9 + if not s: 1.10 + break 1.11 + line += s 1.12 if line.endswith("\r") and self.non_standard_newline: 1.13 return line + "\n" 1.14 else: