summaryrefslogtreecommitdiffstats
path: root/usr.sbin/pkg_install/lib
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/pkg_install/lib')
-rw-r--r--usr.sbin/pkg_install/lib/plist.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/usr.sbin/pkg_install/lib/plist.c b/usr.sbin/pkg_install/lib/plist.c
index e5aa6dc..11e9d13 100644
--- a/usr.sbin/pkg_install/lib/plist.c
+++ b/usr.sbin/pkg_install/lib/plist.c
@@ -320,7 +320,7 @@ write_plist(Package *pkg, FILE *fp)
break;
case PLIST_CWD:
- fprintf(fp, "%ccwd %s\n", CMD_CHAR, plist->name);
+ fprintf(fp, "%ccwd %s\n", CMD_CHAR, (plist->name == NULL) ? "" : plist->name);
break;
case PLIST_SRC:
@@ -420,6 +420,7 @@ delete_package(Boolean ign_err, Boolean nukedirs, Package *pkg)
Boolean fail = SUCCESS;
Boolean preserve;
char tmp[FILENAME_MAX], *name = NULL;
+ char *prefix = NULL;
preserve = find_plist_option(pkg, "preserve") ? TRUE : FALSE;
for (p = pkg->head; p; p = p->next) {
@@ -433,7 +434,9 @@ delete_package(Boolean ign_err, Boolean nukedirs, Package *pkg)
break;
case PLIST_CWD:
- Where = p->name;
+ if (!prefix)
+ prefix = p->name;
+ Where = (p->name == NULL) ? prefix : p->name;
if (Verbose)
printf("Change working directory to %s\n", Where);
break;
OpenPOWER on IntegriCloud