summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/pkg_add/OpenBSD/PackingElement.pm21
1 files changed, 13 insertions, 8 deletions
diff --git a/usr.sbin/pkg_add/OpenBSD/PackingElement.pm b/usr.sbin/pkg_add/OpenBSD/PackingElement.pm
index 80d146307d3..17868364c99 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.203 2012/05/05 10:20:58 espie Exp $
+# $OpenBSD: PackingElement.pm,v 1.204 2012/05/07 17:21:23 espie Exp $
#
# Copyright (c) 2003-2010 Marc Espie <espie@openbsd.org>
#
@@ -206,15 +206,20 @@ sub compute_fullname
}
}
-sub fullname
+sub make_full
{
- my $self = $_[0];
- my $fullname = $self->name;
- if ($fullname !~ m|^/|o && $self->cwd ne '.') {
- $fullname = $self->cwd."/".$fullname;
- $fullname =~ s,^//,/,;
+ my ($self, $path) = @_;
+ if ($path !~ m|^/|o && $self->cwd ne '.') {
+ $path = $self->cwd."/".$path;
+ $path =~ s,^//,/,;
}
- return $fullname;
+ return $path;
+}
+
+sub fullname
+{
+ my $self = shift;
+ return $self->make_full($self->name);
}
sub compute_modes