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:
j = i
binseq = [ch]
while True:
while j < ldata:
ch = data[j]
och = ord(ch)
if och < 1 or (och > 8 and och < 0x80):
break
binseq.append(ch)
j += 1
out.write(pack('>B', len(binseq)))
out.write(''.join(binseq))
i += len(binseq) - 1