From: <bl...@sy...> - 2011-04-06 22:52:21
|
Author: bli Date: 2011-04-06 17:52:15 -0500 (Wed, 06 Apr 2011) New Revision: 4536 Modified: branches/4.2.x/sbin/si_getimage Log: - Only run lc on $update_script if initialized to avoid 'Use of uninitialized value' warning - Disallow passing empty string to --update-script Reported-by: Thomas Zeiser <tho...@rr...> Modified: branches/4.2.x/sbin/si_getimage =================================================================== --- branches/4.2.x/sbin/si_getimage 2011-03-25 21:44:04 UTC (rev 4535) +++ branches/4.2.x/sbin/si_getimage 2011-04-06 22:52:15 UTC (rev 4536) @@ -136,7 +136,9 @@ "quiet" => \$quiet ) || die "$help_info"; -$update_script = lc $update_script; +if ($update_script) { + $update_script = lc $update_script; +} #if requested, print help information if ($help) { @@ -196,8 +198,7 @@ # be sure $update_script was passed a proper option unless( - ($update_script eq "" ) - or ($update_script eq "yes") + ($update_script eq "yes") or ($update_script eq "no" ) ) { die "\n$program_name: --update-script must be yes or no.\n$get_help\n\n"; } |