From 2e1018bc8c867d51647ed2934c8129d39a1cf4e1 Mon Sep 17 00:00:00 2001 From: Michael Hamann Date: Mon, 2 May 2011 21:59:13 +0200 Subject: Add line endings at the end of the file The bug that is fixed here may have corrupted your search index in a way that it produces wrong or missing results and won't be fixed automatically. This occurs when you have deleted the last occurrence of a word that has been on the last line of one of the word indexes. A functionality for checking for a broken search index will be added. The index can be fixed by deleting it completely (remove all .idx files in data/index/) and recreating it using bin/indexer.php -c. The searchindex plugin will be updated to be able to do the same, soon. --- inc/indexer.php | 2 ++ 1 file changed, 2 insertions(+) (limited to 'inc') diff --git a/inc/indexer.php b/inc/indexer.php index d2a38e4a7..03008cd71 100644 --- a/inc/indexer.php +++ b/inc/indexer.php @@ -860,6 +860,8 @@ class Doku_Indexer { $fh = @fopen($fn.'.tmp', 'w'); if (!$fh) return false; fwrite($fh, join("\n", $lines)); + if (!empty($lines)) + fwrite($fh, "\n"); fclose($fh); if (isset($conf['fperm'])) chmod($fn.'.tmp', $conf['fperm']); -- cgit v1.2.3