From f4dfd88d9f2048fffbb1d17efbca8f6b941a8efb Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Wed, 6 Nov 2013 17:02:01 -0500 Subject: [PATCH] handle bad config lines better --- scripts/ZoneMinder/lib/ZoneMinder/Config.pm.in | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/ZoneMinder/lib/ZoneMinder/Config.pm.in b/scripts/ZoneMinder/lib/ZoneMinder/Config.pm.in index fbd9ea374..a840db080 100644 --- a/scripts/ZoneMinder/lib/ZoneMinder/Config.pm.in +++ b/scripts/ZoneMinder/lib/ZoneMinder/Config.pm.in @@ -78,7 +78,11 @@ BEGIN { next if ( $str =~ /^\s*$/ ); next if ( $str =~ /^\s*#/ ); - my ( $name, $value ) = $str =~ /^\s*([^=\s]+)\s*=\s*(.+?)\s*$/; + my ( $name, $value ) = $str =~ /^\s*([^=\s]+)\s*=\s*(.*?)\s*$/; + if ( ! $name ) { + print( STDERR "Warning, bad line in $config_file: $str\n" ); + next; + } # end if $name =~ tr/a-z/A-Z/; *{$name} = sub { $value }; push( @EXPORT_CONFIG, $name );