From 1b771b9577d20a4638bba0b7efbb646f1d496354 Mon Sep 17 00:00:00 2001 From: "Jordan K. Hubbard" Date: Wed, 11 Nov 1998 06:09:04 +0000 Subject: [PATCH] Fix bug where trailing slash could confuse the registry removal. Noticed by: des --- usr.sbin/pkg_install/delete/perform.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/usr.sbin/pkg_install/delete/perform.c b/usr.sbin/pkg_install/delete/perform.c index 97b9528b5402..f5de2b234cf8 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)