aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGleb Smirnoff <glebius@FreeBSD.org>2021-09-10 21:49:17 +0000
committerGleb Smirnoff <glebius@FreeBSD.org>2021-09-10 21:49:17 +0000
commitc96b4d87ba3336e6d4bea04c49d6abde158b7aae (patch)
treec02926090ba199f4283858e44bdcfd34d9919045
parent141fe2dceeaeefaaffc2242c8652345a081e825a (diff)
pkg: fix regression that breaks bootstrap from not a current directory.
Fixes: 40b9f924b18 Reviewed by: kevans
-rw-r--r--usr.sbin/pkg/pkg.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/usr.sbin/pkg/pkg.c b/usr.sbin/pkg/pkg.c
index 1196c78e5cc9..292f4a68b824 100644
--- a/usr.sbin/pkg/pkg.c
+++ b/usr.sbin/pkg/pkg.c
@@ -1063,9 +1063,13 @@ cleanup:
static bool
pkg_is_pkg_pkg(const char *pkg)
{
- char *vstart;
+ char *vstart, *basename;
size_t namelen;
+ /* Strip path. */
+ if ((basename = strrchr(pkg, '/')) != NULL)
+ pkg = basename + 1;
+
/*
* Chop off the final "-" (version delimiter) and check the name that
* precedes it. If we didn't have a version delimiter, it must be the