[yast-commit] r54461 - /trunk/mail/agents/MasterCFParser.pm
Author: varkoly Date: Thu Jan 8 13:16:30 2009 New Revision: 54461 URL: http://svn.opensuse.org/viewcvs/yast?rev=54461&view=rev Log: Avoid undefined variables Modified: trunk/mail/agents/MasterCFParser.pm Modified: trunk/mail/agents/MasterCFParser.pm URL: http://svn.opensuse.org/viewcvs/yast/trunk/mail/agents/MasterCFParser.pm?rev=54461&r1=54460&r2=54461&view=diff ============================================================================== --- trunk/mail/agents/MasterCFParser.pm (original) +++ trunk/mail/agents/MasterCFParser.pm Thu Jan 8 13:16:30 2009 @@ -71,7 +71,6 @@ package MasterCFParser; use strict; -use Data::Dumper; no warnings 'redefine'; ###################################################################################### @@ -140,8 +139,10 @@ while( defined $CFA[$c+1] && $CFA[$c+1] =~ /^\s+/ ) { $line .= $CFA[++$c]; } - - push @$cfa, line2service($line); + if( $line =~ /\w+/ ) + { #avoid emty lines + push @$cfa, line2service($line); + } } $this->{MCF} = $cfa; return 0; @@ -247,7 +248,10 @@ next if defined $s->{comment}; $foundmatches = 0; foreach my $fs ( keys %$fsrv ) { - $foundmatches++ if $fsrv->{$fs} eq $s->{$fs}; + if( defined $fsrv->{$fs} && defined $s->{$fs} ) + { + $foundmatches++ if $fsrv->{$fs} eq $s->{$fs}; + } } push @$retsrv, $s if $foundmatches == $nrkeys; } @@ -420,7 +424,9 @@ my $line = ''; if( defined $srv->{comment} ) { $line = $srv->{comment}; - } else { + } + elsif( defined $srv->{service} && $srv->{type} && $srv->{private} && $srv->{unpriv} && $srv->{chroot} && $srv->{wakeup} && $srv->{maxproc} && $srv->{command} ) + { $line = sprintf("%-8s %-5s %-6s %-7s %-7s %-8s %-7s %s", $srv->{service}, -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org
participants (1)
-
varkoly@svn.opensuse.org