summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--inc/indexer.php8
1 files changed, 7 insertions, 1 deletions
diff --git a/inc/indexer.php b/inc/indexer.php
index 087113587..34ce0cdd0 100644
--- a/inc/indexer.php
+++ b/inc/indexer.php
@@ -620,10 +620,16 @@ class Doku_Indexer {
while (($curline = fgets($ih)) !== false) {
fwrite($fh, (++$ln == $id) ? $line : $curline);
}
- if ($id > $ln)
+ if ($id > $ln) {
+ while ($id > ++$ln)
+ fwrite($fh, "\n");
fwrite($fh, $line);
+ }
fclose($ih);
} else {
+ $ln = -1;
+ while ($id > ++$ln)
+ fwrite($fh, "\n");
fwrite($fh, $line);
}
fclose($fh);