From a1be74d9559285198d8a6e25a8976088daefa090 Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Thu, 3 Jun 2010 22:22:34 +0200 Subject: use perl for generating the line numbers less forking is better Signed-off-by: Florian Pritz --- system/application/models/file_mod.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/application') diff --git a/system/application/models/file_mod.php b/system/application/models/file_mod.php index efb30005a..66817a7a6 100644 --- a/system/application/models/file_mod.php +++ b/system/application/models/file_mod.php @@ -176,7 +176,7 @@ class File_mod extends Model { echo $this->load->view('file/html_header', $data, true); // only rewrite if it's fast // count(file($file)); isn't - echo shell_exec('/usr/bin/seq 1 $(/usr/bin/wc -l '.escapeshellarg($file).' | /bin/cut -d\ -f1) | sed -r \'s/^(.*)$/\1<\/a>/g\''); + echo passthru('/usr/bin/perl -ne \'print "$.\n"\' '.escapeshellarg($file)); echo '
'."\n";
           echo shell_exec(FCPATH.'scripts/syntax-highlighting.sh '.escapeshellarg($filedata['filename']).'.'.escapeshellarg($mode).' < '.escapeshellarg($file));
           echo $this->load->view('file/html_footer', $data, true);
-- 
cgit v1.2.3-24-g4f1b