diff options
author | jkh <jkh@FreeBSD.org> | 1997-03-06 10:21:57 +0000 |
---|---|---|
committer | jkh <jkh@FreeBSD.org> | 1997-03-06 10:21:57 +0000 |
commit | 940fd156aef284cde69149f9ba8eddeff68902cf (patch) | |
tree | d9842dd3577f6e6e8e94a436c8cc994a7e37100f /usr.sbin/pkg_install/delete/perform.c | |
parent | 189d91654bcf1b453f5644b76add5421384c88cb (diff) | |
download | FreeBSD-src-940fd156aef284cde69149f9ba8eddeff68902cf.zip FreeBSD-src-940fd156aef284cde69149f9ba8eddeff68902cf.tar.gz |
Protect against missing initial @cwd. Closes PR#2893
Submitted-By: pius@iago.ienet.com
Diffstat (limited to 'usr.sbin/pkg_install/delete/perform.c')
-rw-r--r-- | usr.sbin/pkg_install/delete/perform.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/usr.sbin/pkg_install/delete/perform.c b/usr.sbin/pkg_install/delete/perform.c index b19592c..4187a8c 100644 --- a/usr.sbin/pkg_install/delete/perform.c +++ b/usr.sbin/pkg_install/delete/perform.c @@ -1,5 +1,5 @@ #ifndef lint -static const char *rcsid = "$Id$"; +static const char *rcsid = "$Id: perform.c,v 1.12 1997/02/22 16:09:37 peter Exp $"; #endif /* @@ -93,8 +93,12 @@ pkg_do(char *pkg) add_plist(&Plist, PLIST_CWD, Prefix); read_plist(&Plist, cfile); fclose(cfile); - setenv(PKG_PREFIX_VNAME, - (p = find_plist(&Plist, PLIST_CWD)) ? p->name : NULL, 1); + p = find_plist(&Plist, PLIST_CWD); + if (!p) { + whinge("Package '%s' doesn't have a prefix.", pkg); + return 1; + } + setenv(PKG_PREFIX_VNAME, p->name, 1); if (fexists(REQUIRE_FNAME)) { if (Verbose) printf("Executing 'require' script.\n"); |