From 8c9442d0b93a03c7c0ed726c806b9d3931e400f9 Mon Sep 17 00:00:00 2001 From: Ringo Wantanabe Date: Mon, 13 Aug 2018 02:02:03 +0100 Subject: [PATCH] Fix searching in file buffer --- deps | 1 + rtbw.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/deps b/deps index 8611f32..9ee8b19 100644 --- a/deps +++ b/deps @@ -1 +1,2 @@ pylzma +argparse diff --git a/rtbw.py b/rtbw.py index 0f84864..86d1d46 100644 --- a/rtbw.py +++ b/rtbw.py @@ -242,7 +242,7 @@ class FileBuffer(StatBuffer): super()._unlock() def clear(self): super()._lock() - self.file.truncate() + self.file.truncate(0) super()._unlock() def findMax(self): super()._lock() @@ -257,7 +257,7 @@ class FileBuffer(StatBuffer): def readno(self, floor): super()._lock() posts = list() - ent = self._skipentry() + ent = self._readentry() while self.file.tell()>0 and ent!=None: if(ent["no"]<=floor): break posts.append(ent)