pm

barely a pack manager
git clone git://z3bra.org/pm
Log | Files | Refs | README | LICENSE

commit 0405ec2471da2017467913b577de031c00207a64
parent 070bae1b48719edc68bd7975cc5a536274eb8fa7
Author: z3bra <willyatmailoodotorg>
Date:   Tue Jan  5 12:08:32 2016

Protect from segfault when loading packs

Diffstat:
 pm.c |  9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/pm.c b/pm.c @@ -534,10 +534,11 @@ main (int argc, char **argv) switch (action) { case ACTION_INSTALL: while(*argv) { - p = pack_load(*(argv++)); - metadata(PACKAGE_DATA, p); - unpack(PACKAGE_ROOT, p->path); - pack_unload(p); + if ((p = pack_load(*(argv++)))) { + metadata(PACKAGE_DATA, p); + unpack(PACKAGE_ROOT, p->path); + pack_unload(p); + } } break;