diff --git a/lib/exe/indexer.php b/lib/exe/indexer.php
index 04229edcd5b371f3d3ceed172edde63f7f908465..8f2205fe55c8b949c3896cc05a2d8ab1570038ee 100644
--- a/lib/exe/indexer.php
+++ b/lib/exe/indexer.php
@@ -67,10 +67,10 @@ function runTrimRecentChanges() {
         !@file_exists($conf['changelog'].'_tmp')) {
             io_lock($conf['changelog']);
             $lines = file($conf['changelog']);
-            if (count($lines)<$conf['recent']) {
+            if (count($lines)<=$conf['recent']) {
                 // nothing to trim
                 io_unlock($conf['changelog']);
-                return true;
+                return false;
             }
 
             io_saveFile($conf['changelog'].'_tmp', '');          // presave tmp as 2nd lock