Browse Source

dpkg-source: Check if the opmode option is defined before use

This was producing an unitialized value usage perl warning when using
--help or --version.
Guillem Jover 16 years ago
parent
commit
162b4055bd
1 changed files with 2 additions and 1 deletions
  1. 2 1
      scripts/dpkg-source.pl

+ 2 - 1
scripts/dpkg-source.pl

@@ -84,7 +84,8 @@ while (@ARGV && $ARGV[0] =~ m/^-/) {
 }
 
 my $dir;
-if ($options{'opmode'} =~ /^(-b|--print-format)$/) {
+if (defined($options{'opmode'}) &&
+    $options{'opmode'} =~ /^(-b|--print-format)$/) {
     if (not scalar(@ARGV)) {
 	usageerr(_g("%s needs a directory"), $options{'opmode'});
     }