From ae4a7015e19854552e2e85fde88cc6de525eebbc Mon Sep 17 00:00:00 2001 From: fukachan Date: Tue, 9 Oct 2001 12:39:50 +0000 Subject: check $config->{ $x } is defined() or not --- fml/libexec/Standalone.pm | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'fml/libexec') diff --git a/fml/libexec/Standalone.pm b/fml/libexec/Standalone.pm index 7f0de8ac..de714b0e 100644 --- a/fml/libexec/Standalone.pm +++ b/fml/libexec/Standalone.pm @@ -4,7 +4,7 @@ # All rights reserved. This program is free software; you can # redistribute it and/or modify it under the same terms as Perl itself. # -# $FML: Standalone.pm,v 1.5 2001/04/24 03:50:25 fukachan Exp $ +# $FML: Standalone.pm,v 1.6 2001/05/29 16:21:17 fukachan Exp $ # @@ -109,8 +109,10 @@ sub _expand_variables # check whether the variable definition is recursive. # For example, definition "var_a = $var_a/b/c" causes a loop. for my $x ( @order ) { - if ($config->{ $x } =~ /\$$x/) { - croak("loop1: definition of $x is recursive\n"); + if ((defined $x) && defined ($config->{ $x })) { + if ($config->{ $x } =~ /\$$x/) { + croak("loop1: definition of $x is recursive\n"); + } } } @@ -119,6 +121,7 @@ sub _expand_variables my $max = 0; KEY: for my $x ( @order ) { + next KEY unless defined($config->{ $x }); next KEY if $config->{ $x } !~ /\$/o; # we need a loop to expand nested variables, for example, -- cgit v1.2.1