Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-1-6]: src/usr.sbin/pkg_install/lib Pullup rev 1.57-1.58 (requeste...



details:   https://anonhg.NetBSD.org/src/rev/45f4199d0bdd
branches:  netbsd-1-6
changeset: 530085:45f4199d0bdd
user:      jmc <jmc%NetBSD.org@localhost>
date:      Sat Feb 08 07:52:05 2003 +0000

description:
Pullup rev 1.57-1.58 (requested by abs in ticket #1141)
 Catchup to -current as of version 20030202.

diffstat:

 usr.sbin/pkg_install/lib/file.c |  18 +++++++++++-------
 1 files changed, 11 insertions(+), 7 deletions(-)

diffs (66 lines):

diff -r 11674b919eae -r 45f4199d0bdd usr.sbin/pkg_install/lib/file.c
--- a/usr.sbin/pkg_install/lib/file.c   Sat Feb 08 07:51:39 2003 +0000
+++ b/usr.sbin/pkg_install/lib/file.c   Sat Feb 08 07:52:05 2003 +0000
@@ -1,11 +1,11 @@
-/*     $NetBSD: file.c,v 1.48.2.5 2002/11/24 22:34:29 tron Exp $       */
+/*     $NetBSD: file.c,v 1.48.2.6 2003/02/08 07:52:05 jmc Exp $        */
 
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static const char *rcsid = "from FreeBSD Id: file.c,v 1.29 1997/10/08 07:47:54 charnier Exp";
 #else
-__RCSID("$NetBSD: file.c,v 1.48.2.5 2002/11/24 22:34:29 tron Exp $");
+__RCSID("$NetBSD: file.c,v 1.48.2.6 2003/02/08 07:52:05 jmc Exp $");
 #endif
 #endif
 
@@ -184,7 +184,7 @@
        assert(max > 0);
 
        if ((i = URLlength(fname)) < 0) {       /* invalid URL? */
-               errx(1, "fileURLhost called with a bad URL: `%s'", fname);
+               errx(EXIT_FAILURE, "fileURLhost called with a bad URL: `%s'", fname);
        }
        fname += i;
        /* Do we have a place to stick our work? */
@@ -209,7 +209,7 @@
        assert(max > 0);
 
        if ((i = URLlength(fname)) < 0) {       /* invalid URL? */
-               errx(1, "fileURLFilename called with a bad URL: `%s'", fname);
+               errx(EXIT_FAILURE, "fileURLFilename called with a bad URL: `%s'", fname);
        }
        fname += i;
        /* Do we have a place to stick our work? */
@@ -240,7 +240,7 @@
 
        rp = NULL;
        if (!IS_URL(spec)) {
-               errx(1, "fileGetURL was called with non-url arg '%s'", spec);
+               errx(EXIT_FAILURE, "fileGetURL was called with non-url arg '%s'", spec);
        }
 
        /* Some sanity checks on the URL */
@@ -378,7 +378,7 @@
                else {
                        char cwdtmp[MAXPATHLEN];
                        if (getcwd(cwdtmp, sizeof(cwdtmp)) == NULL)
-                               errx(1, "getcwd");
+                               errx(EXIT_FAILURE, "getcwd");
                        snprintf(tmp, sizeof(tmp), "%s/%s/%s", cwdtmp, cp2, fname);
                }
                cp = resolvepattern(tmp);
@@ -568,7 +568,11 @@
 
        for (bufp = buf; (int) (bufp - buf) < size && *fmt;) {
                if (*fmt == '%') {
-                       switch (*++fmt) {
+                       if (*++fmt != 'D' && name == NULL) {
+                               cleanup(0);
+                               errx(2, "no last file available for '%s' command", buf);
+                       }
+                       switch (*fmt) {
                        case 'F':
                                strnncpy(bufp, size - (int) (bufp - buf), name, strlen(name));
                                bufp += strlen(bufp);



Home | Main Index | Thread Index | Old Index