Revision: 127
http://logwatch.svn.sourceforge.net/logwatch/?rev=127&view=rev
Author: stefjakobs
Date: 2013-01-02 21:39:00 +0000 (Wed, 02 Jan 2013)
Log Message:
-----------
prevent error "Use of uninitialized value $FileList[0]" if LogFile Group
of service is not set. Print a warning and skip that service.
Modified Paths:
--------------
scripts/logwatch.pl
Modified: scripts/logwatch.pl
===================================================================
--- scripts/logwatch.pl 2013-01-02 19:31:04 UTC (rev 126)
+++ scripts/logwatch.pl 2013-01-02 21:39:00 UTC (rev 127)
@@ -1327,13 +1327,17 @@
}
my $Command = '';
- if ($FileList[0] eq 'none') {
- $Command = " $FilterText 2>&1 ";
- } elsif ($FileText) {
- if ($HostStrip ne " ") {
- $Command = " ( $Config{'pathtocat'} $FileText | $HostStrip | $FilterText) 2>&1 ";
- } else {
- $Command = " ( $Config{'pathtocat'} $FileText | $FilterText) 2>&1 ";
+ if (! @FileList) {
+ output(1, "\n Warning: LogFile of service $ServiceData{$Service}{title} is not defined.\n", "line");
+ } else {
+ if ($FileList[0] eq 'none') {
+ $Command = " $FilterText 2>&1 ";
+ } elsif ($FileText) {
+ if ($HostStrip ne " ") {
+ $Command = " ( $Config{'pathtocat'} $FileText | $HostStrip | $FilterText) 2>&1 ";
+ } else {
+ $Command = " ( $Config{'pathtocat'} $FileText | $FilterText) 2>&1 ";
+ }
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
------------------------------------------------------------------------------
Master Java SE, Java EE, Eclipse, Spring, Hibernate, JavaScript, jQuery
and much more. Keep your Java skills current with LearnJavaNow -
200+ hours of step-by-step video tutorials by Java experts.
SALE $49.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122612
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.