From: Graham Knop Date: Sun, 24 Nov 2013 11:09:57 +0000 (-0500) Subject: normalize path whenever possible, not only on activate X-Git-Tag: v2.000_000~22 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=88b1d6dfb11c10300dac8625711744f7089d1019;p=p5sagit%2Flocal-lib.git normalize path whenever possible, not only on activate --- diff --git a/lib/local/lib.pm b/lib/local/lib.pm index 254fa45..9d7d69e 100644 --- a/lib/local/lib.pm +++ b/lib/local/lib.pm @@ -181,6 +181,7 @@ sub deactivate { my ($self, $path) = @_; $self = $self->new unless ref $self; $path = $self->resolve_path($path); + $path = $self->normalize_path($path); my @active_lls = $self->active_paths; @@ -232,8 +233,7 @@ sub activate { $self->ensure_dir_structure_for($path) unless $self->no_create; - $path = ( Win32::GetShortPathName($path) || $path ) - if $^O eq 'MSWin32'; + $path = $self->normalize_path($path); my @active_lls = $self->active_paths; @@ -256,6 +256,13 @@ sub activate { $self->clone(%args); } +sub normalize_path { + my ($self, $path) = @_; + $path = ( Win32::GetShortPathName($path) || $path ) + if $^O eq 'MSWin32'; + return $path; +} + sub _legacy { my ($self, $path) = @_; $self = $self->new unless ref $self;