Fix use of uninitialized value $config{"options"}

When no options are specified for a deb line in the config (e.g. no
[arch=amd64] or similar), apt-mirror will print a warning:

Use of uninitialized value $config{"options"} in pattern match (m//) at
apt-mirror line 300, <CONFIG> line 6.

fixes #68
pull/83/merge
Benjamin Drung 5 years ago
parent 592dee578c
commit 31dc83f370
  1. 2
      apt-mirror

@ -294,7 +294,7 @@ sub parse_config_line
if ( $line =~ $pattern_deb_line ) {
$config{'type'} = $+{type};
$config{'arch'} = $+{arch};
$config{'options'} = $+{options};
$config{'options'} = $+{options} ? $+{options} : "";
$config{'uri'} = $+{uri};
$config{'components'} = $+{components};
if ( $config{'options'} =~ /arch=((?<arch>[\w\-]+)[,]*)/g ) {

Loading…
Cancel
Save