summaryrefslogtreecommitdiffstats
path: root/usr.sbin/pkg_install
diff options
context:
space:
mode:
authorjkh <jkh@FreeBSD.org>1998-11-11 06:09:04 +0000
committerjkh <jkh@FreeBSD.org>1998-11-11 06:09:04 +0000
commitec5ce5a2f507538083c1059a76ae1fbc7c484330 (patch)
tree77f59ab7accf18edad7a50eaa9271c130358b35e /usr.sbin/pkg_install
parentf8dcb23dba255068fa5ac32328a680849f941f09 (diff)
downloadFreeBSD-src-ec5ce5a2f507538083c1059a76ae1fbc7c484330.zip
FreeBSD-src-ec5ce5a2f507538083c1059a76ae1fbc7c484330.tar.gz
Fix bug where trailing slash could confuse the registry removal.
Noticed by: des
Diffstat (limited to 'usr.sbin/pkg_install')
-rw-r--r--usr.sbin/pkg_install/delete/perform.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/usr.sbin/pkg_install/delete/perform.c b/usr.sbin/pkg_install/delete/perform.c
index 97b9528..f5de2b2 100644
--- a/usr.sbin/pkg_install/delete/perform.c
+++ b/usr.sbin/pkg_install/delete/perform.c
@@ -1,6 +1,6 @@
#ifndef lint
static const char rcsid[] =
- "$Id: perform.c,v 1.15 1997/10/13 15:03:52 jkh Exp $";
+ "$Id: perform.c,v 1.16 1998/09/11 07:26:58 jkh Exp $";
#endif
/*
@@ -53,6 +53,12 @@ pkg_do(char *pkg)
char home[FILENAME_MAX];
PackingList p;
char *tmp;
+ int len;
+
+ if (!pkg || !(len = strlen(pkg)))
+ return 1;
+ if (pkg[len - 1] == '/')
+ pkg[len - 1] = '\0';
/* Reset some state */
if (Plist.head)
OpenPOWER on IntegriCloud