Fix minor error in Palmdoc compression implementation.

This commit is contained in:
Marshall T. Vandegrift 2009-01-02 09:14:39 -05:00
parent 937cbdb20e
commit fc59f7b63d

View File

@ -74,12 +74,13 @@ def compress_doc(data):
else: else:
j = i j = i
binseq = [ch] binseq = [ch]
while True: while j < ldata:
ch = data[j] ch = data[j]
och = ord(ch) och = ord(ch)
if och < 1 or (och > 8 and och < 0x80): if och < 1 or (och > 8 and och < 0x80):
break break
binseq.append(ch) binseq.append(ch)
j += 1
out.write(pack('>B', len(binseq))) out.write(pack('>B', len(binseq)))
out.write(''.join(binseq)) out.write(''.join(binseq))
i += len(binseq) - 1 i += len(binseq) - 1