# HG changeset patch # User Henry S. Thompson # Date 1773941013 0 # Node ID d858ad223646faaae6564d9ffff7d660ece048e6 # Parent 97e049b06f691b666f6f8e7c8ee9be05b59cfc0d handle missed negative case diff -r 97e049b06f69 -r d858ad223646 lib/python/cc/lmh/shrink_key.py --- a/lib/python/cc/lmh/shrink_key.py Thu Mar 19 17:21:51 2026 +0000 +++ b/lib/python/cc/lmh/shrink_key.py Thu Mar 19 17:23:33 2026 +0000 @@ -20,14 +20,17 @@ def shrink_key(seg: int, fileno: int, offset: int, lm: int) -> tuple[bytes,bytes]: lmb: bytes - if (lm >= 0 and lm <= 2147483647): - lmb=int.to_bytes(lm,4) + if lm >= 0: + if lm <= 2147483647: + lmb = int.to_bytes(lm, 4) + else: + lmb = LAST_DATE else: if lm < -2147483647: lmb = FIRST_DATE - if lm > 2147483647: - lmb = LAST_DATE - #print(nd,uri[4:],file=sys.stderr) + else: + lmb = int.to_bytes(lm, 4, signed=True) + return (int.to_bytes(seg,1)+int.to_bytes(fileno,2)+int.to_bytes(offset,4),lmb) def shrink_date(wdate: bytes, dp: bytes) -> bytes: