mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix minor error in Palmdoc compression implementation.
This commit is contained in:
parent
937cbdb20e
commit
fc59f7b63d
@ -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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user