diff -Nur -x '*.orig' -x '*.rej' e-smith-viewlogfiles-1.8.0/root/etc/e-smith/web/functions/viewlogfiles mezzanine_patched_e-smith-viewlogfiles-1.8.0/root/etc/e-smith/web/functions/viewlogfiles
--- e-smith-viewlogfiles-1.8.0/root/etc/e-smith/web/functions/viewlogfiles 2006-03-15 14:31:03.000000000 -0500
+++ mezzanine_patched_e-smith-viewlogfiles-1.8.0/root/etc/e-smith/web/functions/viewlogfiles 2007-09-29 11:18:54.000000000 -0400
@@ -7,7 +7,7 @@
#
# $Id: viewlogfiles,v 1.31 2005/08/25 21:08:41 charlieb Exp $
#----------------------------------------------------------------------
-# copyright (C) 1999-2005 Mitel Networks Corporation
+# copyright (C) 1999-2007 Mitel Networks Corporation
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -120,11 +120,18 @@
our %logfiles = ();
-sub tai64nlocal
+sub timestamp2local
{
- my $line = shift;
- return $line unless ($line =~ /^(\@[0-9a-f]{24})(.*)/s);
- return Time::TAI64::tai64nlocal($1) . $2;
+ $_ = shift;
+ if (/^(\@[0-9a-f]{24})(.*)/s)
+ {
+ return Time::TAI64::tai64nlocal($1) . $2;
+ }
+ elsif (/^([0-9]{10}\.[0-9]{3})(.*)/s)
+ {
+ return localtime($1) . $2;
+ }
+ return $_;
}
sub findlogFiles
@@ -160,7 +167,7 @@
if ( $file_base =~ /@.*/ )
{
- $logfiles{$path} = $file_path . tai64nlocal($file_base);
+ $logfiles{$path} = $file_path . timestamp2local($file_base);
}
else
{
@@ -274,7 +281,7 @@
next unless /$matchPattern/;
$somethingMatched = 1;
- $_ = tai64nlocal($_);
+ $_ = timestamp2local($_);
$_ = HTML::Entities::encode_entities($_);
($highlightPattern && /$highlightPattern/)
? print "$_"
@@ -398,7 +405,7 @@
while (my $line = )
{
chomp $line;
- print tai64nlocal($line) . $nl;
+ print timestamp2local($line) . $nl;
}
close(FILE);