From f6c1156da1010ead5d5c37d4e70bdd7d1f7e9a5f Mon Sep 17 00:00:00 2001
From: Wolfgang Ocker <weo@weo1.de>
Date: Mon, 9 Jan 2006 22:19:29 +0100
Subject: [PATCH] Small patch to recent changes list

In the "recent changes" list I've seen some artefacts. This patch
fixes them.

darcs-hash:20060109211929-6ddad-2f467e426b661fb978160c0bfd419abd50537931.gz
---
 inc/common.php | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/inc/common.php b/inc/common.php
index 8fe797187..8ad55efff 100644
--- a/inc/common.php
+++ b/inc/common.php
@@ -733,7 +733,11 @@ function getRecents($first,$num,$ns='',$flags=0){
   // now read backwards into buffer
   while($pos > 0){
     $pos -= $csz;                           // seek to previous chunk...
-    if($pos < 0) $pos = 0;                  // ...or rest of file
+    if($pos < 0) {                          // ...or rest of file
+      $csz += $pos; 
+      $pos = 0;
+    }
+
     fseek($fh,$pos);
 
     $buf = fread($fh,$csz).$buf;            // prepend to buffer
-- 
GitLab