From c1dce312060465d7226fe18a0bcdcd2e82f8c91a Mon Sep 17 00:00:00 2001 From: rudolfkoenig Date: Fri, 17 Feb 2012 12:33:41 +0000 Subject: [PATCH] avoid undefined git-svn-id: svn://svn.code.sf.net/p/fhem/code/trunk@1262 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/92_FileLog.pm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/fhem/FHEM/92_FileLog.pm b/fhem/FHEM/92_FileLog.pm index 61d91991d..959f269bf 100755 --- a/fhem/FHEM/92_FileLog.pm +++ b/fhem/FHEM/92_FileLog.pm @@ -190,12 +190,15 @@ FileLog_Get($@) } FileLog_Switch($hash); - if($inf eq "-") { $inf = $hash->{currentlogfile}; + } else { - my $linf = "$1/$inf" if($hash->{currentlogfile} =~ m,^(.*)/[^/]*$,o); + # Look for the file in the log directory... + my $linf = "$1/$inf" if($hash->{currentlogfile} =~ m,^(.*)/[^/]*$,); + return undef if(!$linf); if(!-f $linf) { + # ... or in the archivelog $linf = AttrVal($hash->{NAME},"archivedir",".") ."/". $inf; return "Error: cannot access $linf" if(!-f $linf); }