diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2004-11-12 23:00:47 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2004-11-12 23:00:47 +0000 |
commit | a40b4104f944dfb349288679fe30e63bbbf741b9 (patch) | |
tree | 3ba50ba9f06842d689cd8ebf59c6bb3729aa2c16 /usr.sbin/pkg_add | |
parent | 9deff8ec7d9e2081ac2456a2d544fb25dd708da2 (diff) |
avoid even more calls to canonpath.
Diffstat (limited to 'usr.sbin/pkg_add')
-rw-r--r-- | usr.sbin/pkg_add/OpenBSD/PackingElement.pm | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/PackingElement.pm b/usr.sbin/pkg_add/OpenBSD/PackingElement.pm index 6bf689b5f53..8861c9d6516 100644 --- a/usr.sbin/pkg_add/OpenBSD/PackingElement.pm +++ b/usr.sbin/pkg_add/OpenBSD/PackingElement.pm @@ -1,5 +1,5 @@ # ex:ts=8 sw=4: -# $OpenBSD: PackingElement.pm,v 1.66 2004/11/12 22:48:31 espie Exp $ +# $OpenBSD: PackingElement.pm,v 1.67 2004/11/12 23:00:46 espie Exp $ # # Copyright (c) 2003-2004 Marc Espie <espie@openbsd.org> # @@ -155,6 +155,7 @@ sub compute_fullname my ($self, $state, $absolute_okay) = @_; $self->{cwd} = $state->{cwd}; + $self->{name} = File::Spec->canonpath($self->{name}); if ($self->{name} =~ m|^/|) { unless ($absolute_okay) { die "Absolute name forbidden: ", $self->{name}; @@ -166,10 +167,9 @@ sub fullname($) { my $self = $_[0]; my $fullname = $self->{name}; - unless ($fullname =~ m|^/|) { + if ($fullname !~ m|^/| && $self->{cwd} ne '.') { $fullname = $self->{cwd}."/".$fullname; } - $fullname = File::Spec->canonpath($fullname); return $fullname; } @@ -834,7 +834,7 @@ sub keyword() { 'cwd' } sub destate { my ($self, $state) = @_; - $state->{cwd} = $self->{name}; + $state->{cwd} = File::Spec->canonpath($self->{name}); } package OpenBSD::PackingElement::EndFake; |