Index: /trunk/FACT++/www/showlog/index.php
===================================================================
--- /trunk/FACT++/www/showlog/index.php	(revision 18167)
+++ /trunk/FACT++/www/showlog/index.php	(revision 18168)
@@ -335,15 +335,9 @@
 
 $size = filesize($filename);
-if ($size>30000000) // 30MB
-{
-    header('HTTP/1.1 403 File too large.');
-    print("File too large.\n");
-    return;
-}
-
-// FIXME: Reading the file line by line avoids any danger that
-//        something yields a problem if files grow too large
-$file = file($filename);
-if ($file===false)
+
+$file=array();
+$fp = fopen($filename, "r");
+
+if ($fp===false)
 {
     header('HTTP/1.1 403 Access forbidden.');
@@ -352,12 +346,13 @@
 }
 
-$max = 10000;
-$pos = 500;
-$n = count($file);
-if ($n>$max)
-{
-    $file[$pos] = "\n<b>[...]</b>\n\n";
-    array_splice($file, $pos+1, $n-$max);
-}
+fseek($fp, -min(10000000, $size), SEEK_END);
+fgets($fp);
+while(!feof($fp))
+{
+   $line = fgets($fp);
+   array_push($file, $line);
+}
+fclose($fp);
+
 
 $dir  = basename(dirname($filename));
