Fix activate_paths when PERL_LOCAL_LIB_ROOT starts with ':'
[p5sagit/local-lib.git] / lib / local / lib.pm
index 996cd6b..5a6d9ab 100644 (file)
@@ -375,7 +375,7 @@ my %ENV_LIST_VALUE_DEFAULTS = (
     filter => sub { 1 },
     empty => undef,
 );
-sub _env_list_value(%@) {
+sub _env_list_value {
   my $options = shift;
   die(sprintf "unknown option '$_' at %s line %u\n", (caller)[1..2])
     for grep { !exists $ENV_LIST_VALUE_DEFAULTS{$_} } keys %$options;
@@ -423,6 +423,7 @@ sub build_activate_environment_vars_for {
             ),
     PATH => _env_list_value(
               { interpolate => $interpolate, exists => 0, empty => '' },
+             $class->install_base_bin_path($path),
               \'PATH',
             ),
   )
@@ -432,7 +433,7 @@ sub active_paths {
   my ($class) = @_;
 
   return () unless defined $ENV{PERL_LOCAL_LIB_ROOT};
-  return split /\Q$Config{path_sep}/, $ENV{PERL_LOCAL_LIB_ROOT};
+  return grep { $_ ne '' } split /\Q$Config{path_sep}/, $ENV{PERL_LOCAL_LIB_ROOT};
 }
 
 sub build_deactivate_environment_vars_for {