Fixed pkg_add so when it does not find a package, it returns != 0.

PR:		bin/23083
Submitted by:	Patch submitted by Maxime Henrion <mux@qualys.com>
MFC after:	2 weeks
This commit is contained in:
Jim Pirzyk 2001-06-04 21:35:08 +00:00
parent ba44060da7
commit d316920f0c

View File

@ -173,7 +173,8 @@ main(int argc, char **argv)
pkgs[ch] = realpath(*argv, pkgnames[ch]);
else { /* look for the file in the expected places */
if (!(cp = fileFindByPath(NULL, *argv)))
warnx("can't find package '%s'", *argv);
/* let pkg_do() fail later, so that error is reported */
pkgs[ch] = strcpy(pkgnames[ch], *argv);
else {
if (s_strlcpy(pkgnames[ch], cp, sizeof(pkgnames[ch])))
errx(1, "package name too long");