From 80c46f750e1dec3868cf1a71712be11ece9eec2c Mon Sep 17 00:00:00 2001 From: hubertf Date: Fri, 1 Sep 2000 04:36:20 +0000 Subject: [PATCH] * Code cleanup * Add a comment in one appropriate place * Indent properly --- usr.sbin/pkg_install/add/perform.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/usr.sbin/pkg_install/add/perform.c b/usr.sbin/pkg_install/add/perform.c index 470b8450f707..c7cbfc6f399d 100644 --- a/usr.sbin/pkg_install/add/perform.c +++ b/usr.sbin/pkg_install/add/perform.c @@ -1,11 +1,11 @@ -/* $NetBSD: perform.c,v 1.52 2000/06/16 23:49:17 sjg Exp $ */ +/* $NetBSD: perform.c,v 1.53 2000/09/01 04:36:20 hubertf Exp $ */ #include #ifndef lint #if 0 static const char *rcsid = "from FreeBSD Id: perform.c,v 1.44 1997/10/13 15:03:46 jkh Exp"; #else -__RCSID("$NetBSD: perform.c,v 1.52 2000/06/16 23:49:17 sjg Exp $"); +__RCSID("$NetBSD: perform.c,v 1.53 2000/09/01 04:36:20 hubertf Exp $"); #endif #endif @@ -140,10 +140,15 @@ pkg_do(char *pkg) strcpy(buf, s); tmppkg = buf; } - - if (!(Home = fileGetURL(NULL, tmppkg))) { + + Home = fileGetURL(NULL, tmppkg); + if (Home == NULL) { warnx("unable to fetch `%s' by URL", tmppkg); if (ispkgpattern(pkg)) + /* + * Seems we were not able to expand the pattern + * to something useful - bail out + */ return 1; if (strstr(pkg, ".tgz") != NULL) { @@ -152,7 +157,7 @@ pkg_do(char *pkg) * clever - the user should give something sane!) */ return 1; - } + } /* Second chance - maybe just a package name was given, @@ -173,10 +178,11 @@ pkg_do(char *pkg) } strcpy(buf, s); tmppkg = buf; - if (!(Home = fileGetURL(NULL, tmppkg))) { + Home = fileGetURL(NULL, tmppkg); + if (Home == NULL) { warnx("unable to fetch `%s' by URL", tmppkg); - return 1; - } + return 1; + } } } where_to = Home;