X-Git-Url: http://dolda2000.com/gitweb/?a=blobdiff_plain;f=classfile%2Fbinfmt.py;h=cc2f420ee68be652e95c3c7ccbf5653c699bcf43;hb=188fa298c78404f0cb1ed5291cfa53e5be0fb4b2;hp=57671f9c90e84177e2c4a5800fad1e8c3bf8739f;hpb=964561d602931b91c16c71d251a90cb0bd0125d2;p=pycfml.git diff --git a/classfile/binfmt.py b/classfile/binfmt.py index 57671f9..cc2f420 100644 --- a/classfile/binfmt.py +++ b/classfile/binfmt.py @@ -26,7 +26,7 @@ def mutf8dec(bs): b = bs[i] i += 1 if b & 0xc0 != 0x80: raise fmterror("invalid utf8 continuation byte") - acc = (acc << 6) | bs & 0x3f + acc = (acc << 6) | b & 0x3f c -= 1 if iacc == 0 and ic != 2 and acc != 0: raise fmterror("invalid utf8 compound") ret += chr(acc) @@ -93,6 +93,9 @@ class decstream(decoder): self.buf.extend(ret) return False + def tell(self): + return self.bk.tell() - len(self.buf) + def splice(self, ln=-1): buf = self.buf if ln < 0: