pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/pkgtools/pkg_install/files Merge the usedot and ctype-...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/4b62f0792561
branches:  trunk
changeset: 482726:4b62f0792561
user:      erh <erh%pkgsrc.org@localhost>
date:      Tue Nov 02 00:44:00 2004 +0000

description:
Merge the usedot and ctype-function changes from src.

diffstat:

 pkgtools/pkg_install/files/info/perform.c |  11 ++++++-----
 pkgtools/pkg_install/files/lib/ftpio.c    |  24 ++++++++++++------------
 pkgtools/pkg_install/files/lib/str.c      |  16 ++++++++--------
 3 files changed, 26 insertions(+), 25 deletions(-)

diffs (209 lines):

diff -r 6c0fd8fde6d3 -r 4b62f0792561 pkgtools/pkg_install/files/info/perform.c
--- a/pkgtools/pkg_install/files/info/perform.c Tue Nov 02 00:41:30 2004 +0000
+++ b/pkgtools/pkg_install/files/info/perform.c Tue Nov 02 00:44:00 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: perform.c,v 1.16 2004/08/20 20:09:53 jlam Exp $        */
+/*     $NetBSD: perform.c,v 1.17 2004/11/02 00:44:00 erh Exp $ */
 
 #if HAVE_CONFIG_H
 #include "config.h"
@@ -11,7 +11,7 @@
 #if 0
 static const char *rcsid = "from FreeBSD Id: perform.c,v 1.23 1997/10/13 15:03:53 jkh Exp";
 #else
-__RCSID("$NetBSD: perform.c,v 1.16 2004/08/20 20:09:53 jlam Exp $");
+__RCSID("$NetBSD: perform.c,v 1.17 2004/11/02 00:44:00 erh Exp $");
 #endif
 #endif
 
@@ -76,7 +76,7 @@
                        strlcpy(fname, cp, sizeof(fname));
                        isTMP = TRUE;
                }
-       } else if (fexists(pkg) && isfile(pkg)) {
+       } else if (usedot && fexists(pkg) && isfile(pkg)) {
                int     len;
 
                if (*pkg != '/') {
@@ -90,7 +90,7 @@
                        strlcpy(fname, pkg, sizeof(fname));
                }
                cp = fname;
-       } else {
+       } else if (usedot) {
                if ((cp = fileFindByPath(pkg)) != NULL) {
                        strncpy(fname, cp, FILENAME_MAX);
                }
@@ -179,7 +179,8 @@
                        }
 
                        /* No match */
-                       warnx("can't find package `%s' installed or in a file!", pkg);
+                       warnx("can't find package `%s' installed%s!", pkg,
+                             usedot ? " or in a file" : "");
                        return 1;
                }
                if (chdir(log_dir) == FAIL) {
diff -r 6c0fd8fde6d3 -r 4b62f0792561 pkgtools/pkg_install/files/lib/ftpio.c
--- a/pkgtools/pkg_install/files/lib/ftpio.c    Tue Nov 02 00:41:30 2004 +0000
+++ b/pkgtools/pkg_install/files/lib/ftpio.c    Tue Nov 02 00:44:00 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ftpio.c,v 1.11 2004/10/31 02:48:12 grant Exp $ */
+/*     $NetBSD: ftpio.c,v 1.12 2004/11/02 00:44:00 erh Exp $   */
 
 #if HAVE_CONFIG_H
 #include "config.h"
@@ -8,7 +8,7 @@
 #include <sys/cdefs.h>
 #endif
 #ifndef lint
-__RCSID("$NetBSD: ftpio.c,v 1.11 2004/10/31 02:48:12 grant Exp $");
+__RCSID("$NetBSD: ftpio.c,v 1.12 2004/11/02 00:44:00 erh Exp $");
 #endif
 
 /*-
@@ -281,7 +281,7 @@
                                fflush(stdout);
 #endif /* EXPECT_DEBUG */
 
-                               if (ftprc && isdigit(buf[match.rm_so+1])) 
+                               if (ftprc && isdigit((unsigned char)buf[match.rm_so+1])) 
                                        *ftprc = atoi(buf+match.rm_so+1);
 
                                done=1;
@@ -937,14 +937,14 @@
                                state = ST_NONE;
                        else if (p == 'a' || p == 'A')
                                state = ST_LTA;
-                       else if (!isspace(p))
+                       else if (!isspace((unsigned char)p))
                                state = ST_TAG;
                        break;
                case ST_LTA:
                        /* in tag -- "<a" already found */
                        if (p == '>')
                                state = ST_NONE;
-                       else if (isspace(p))
+                       else if (isspace((unsigned char)p))
                                state = ST_TAGA;
                        else
                                state = ST_TAG;
@@ -960,14 +960,14 @@
                                state = ST_NONE;
                        else if (p == 'h' || p == 'H')
                                state = ST_H;
-                       else if (!isspace(p))
+                       else if (!isspace((unsigned char)p))
                                state = ST_TAGAX;
                        break;
                case ST_TAGAX:
                        /* in unknown keyword in a-tag */
                        if (p == '>')
                                state = ST_NONE;
-                       else if (isspace(p))
+                       else if (isspace((unsigned char)p))
                                state = ST_TAGA;
                        break;
                case ST_H:
@@ -976,7 +976,7 @@
                                state = ST_NONE;
                        else if (p == 'r' || p == 'R')
                                state = ST_R;
-                       else if (isspace(p))
+                       else if (isspace((unsigned char)p))
                                state = ST_TAGA;
                        else
                                state = ST_TAGAX;
@@ -987,7 +987,7 @@
                                state = ST_NONE;
                        else if (p == 'e' || p == 'E')
                                state = ST_E;
-                       else if (isspace(p))
+                       else if (isspace((unsigned char)p))
                                state = ST_TAGA;
                        else
                                state = ST_TAGAX;
@@ -998,7 +998,7 @@
                                state = ST_NONE;
                        else if (p == 'f' || p == 'F')
                                state = ST_F;
-                       else if (isspace(p))
+                       else if (isspace((unsigned char)p))
                                state = ST_TAGA;
                        else
                                state = ST_TAGAX;
@@ -1009,7 +1009,7 @@
                                state = ST_NONE;
                        else if (p == '=')
                                state = ST_HREF;
-                       else if (!isspace(p))
+                       else if (!isspace((unsigned char)p))
                                state = ST_TAGAX;
                        break;
                case ST_HREF:
@@ -1018,7 +1018,7 @@
                        if (p == '>')
                                state = ST_NONE;
                        /* skip spaces before URL */
-                       else if (!isspace(p))
+                       else if (!isspace((unsigned char)p))
                                state = ST_TAGA;
                        break;
                        /* no default case by purpose */
diff -r 6c0fd8fde6d3 -r 4b62f0792561 pkgtools/pkg_install/files/lib/str.c
--- a/pkgtools/pkg_install/files/lib/str.c      Tue Nov 02 00:41:30 2004 +0000
+++ b/pkgtools/pkg_install/files/lib/str.c      Tue Nov 02 00:44:00 2004 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: str.c,v 1.7 2003/10/29 23:00:28 jlam Exp $     */
+/*     $NetBSD: str.c,v 1.8 2004/11/02 00:44:00 erh Exp $      */
 
 #if HAVE_CONFIG_H
 #include "config.h"
@@ -11,7 +11,7 @@
 #if 0
 static const char *rcsid = "Id: str.c,v 1.5 1997/10/08 07:48:21 charnier Exp";
 #else
-__RCSID("$NetBSD: str.c,v 1.7 2003/10/29 23:00:28 jlam Exp $");
+__RCSID("$NetBSD: str.c,v 1.8 2004/11/02 00:44:00 erh Exp $");
 #endif
 #endif
 
@@ -109,7 +109,7 @@
 str_lowercase(char *s)
 {
        for (; *s; s++) {
-               *s = tolower(*s);
+               *s = tolower((unsigned char)*s);
        }
 }
 
@@ -210,8 +210,8 @@
                return 0;
        }
        ALLOC(int64_t, ap->v, ap->size, ap->c, 62, "mkver", exit(EXIT_FAILURE));
-       if (isdigit(*num)) {
-               for (cp = num, n = 0 ; isdigit(*num) ; num++) {
+       if (isdigit((unsigned char)*num)) {
+               for (cp = num, n = 0 ; isdigit((unsigned char)*num) ; num++) {
                        n = (n * 10) + (*num - '0');
                }
                ap->v[ap->c++] = n;
@@ -224,15 +224,15 @@
                }
        }
        if (strncasecmp(num, "nb", 2) == 0) {
-               for (cp = num, num += 2, n = 0 ; isdigit(*num) ; num++) {
+               for (cp = num, num += 2, n = 0 ; isdigit((unsigned char)*num) ; num++) {
                        n = (n * 10) + (*num - '0');
                }
                ap->netbsd = n;
                return (int)(num - cp);
        }
-       if (isalpha(*num)) {
+       if (isalpha((unsigned char)*num)) {
                ap->v[ap->c++] = Dot;
-               cp = strchr(alphas, tolower(*num));
+               cp = strchr(alphas, tolower((unsigned char)*num));
                ALLOC(int64_t, ap->v, ap->size, ap->c, 62, "mkver", exit(EXIT_FAILURE));
                ap->v[ap->c++] = (int64_t)(cp - alphas) + 1;
                return 1;



Home | Main Index | Thread Index | Old Index