From: Stephen D. <sd...@us...> - 2005-08-19 08:20:36
|
Update of /cvsroot/naviserver/naviserver/nsd In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25370/nsd Modified Files: fastpath.c nsmain.c pathname.c str.c Log Message: * nsd/fastpath.c: * nsd/nsmain.c: * nsd/pathname.c: * nsd/str.c: Make sure ctype functions are always passed an unsigned char. Index: fastpath.c =================================================================== RCS file: /cvsroot/naviserver/naviserver/nsd/fastpath.c,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** fastpath.c 10 Jul 2005 07:27:13 -0000 1.18 --- fastpath.c 19 Aug 2005 08:20:27 -0000 1.19 *************** *** 724,733 **** * The byte positions specified are inclusive. Byte count start at zero. */ ! if (isdigit(*str)) { rnPtr->offsets[idx].start = atol(str); ! while (isdigit(*str)) str++; if (*str == '-') { str++; ! if (!isdigit(*str)) { rnPtr->offsets[idx].end = rnPtr->size - 1; } else { --- 724,733 ---- * The byte positions specified are inclusive. Byte count start at zero. */ ! if (isdigit(UCHAR(*str))) { rnPtr->offsets[idx].start = atol(str); ! while (isdigit(UCHAR(*str))) str++; if (*str == '-') { str++; ! if (!isdigit(UCHAR(*str))) { rnPtr->offsets[idx].end = rnPtr->size - 1; } else { *************** *** 739,743 **** rnPtr->offsets[idx].end = rnPtr->size - 1; } ! while (isdigit(*str)) str++; } /* At this point we have syntactically valid byte-str-set */ --- 739,743 ---- rnPtr->offsets[idx].end = rnPtr->size - 1; } ! while (isdigit(UCHAR(*str))) str++; } /* At this point we have syntactically valid byte-str-set */ *************** *** 766,770 **** */ str++; ! if (!isdigit(*str)) { return NS_OK; } --- 766,770 ---- */ str++; ! if (!isdigit(UCHAR(*str))) { return NS_OK; } *************** *** 777,781 **** rnPtr->offsets[idx].end = rnPtr->offsets[idx].start + rnPtr->offsets[idx].end - 1; /* At this point we have syntactically valid byte-range-set */ ! while (isdigit(*str)) str++; switch (*str) { case ',': --- 777,781 ---- rnPtr->offsets[idx].end = rnPtr->offsets[idx].start + rnPtr->offsets[idx].end - 1; /* At this point we have syntactically valid byte-range-set */ ! while (isdigit(UCHAR(*str))) str++; switch (*str) { case ',': Index: nsmain.c =================================================================== RCS file: /cvsroot/naviserver/naviserver/nsd/nsmain.c,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** nsmain.c 30 Jul 2005 03:11:06 -0000 1.17 --- nsmain.c 19 Aug 2005 08:20:27 -0000 1.18 *************** *** 597,601 **** if (*cwd == '\\') { *cwd = '/'; ! } else if (isupper(*cwd)) { *cwd = tolower(*cwd); } --- 597,601 ---- if (*cwd == '\\') { *cwd = '/'; ! } else if (isupper(UCHAR(*cwd))) { *cwd = tolower(*cwd); } Index: str.c =================================================================== RCS file: /cvsroot/naviserver/naviserver/nsd/str.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** str.c 19 Aug 2005 07:50:44 -0000 1.5 --- str.c 19 Aug 2005 08:20:27 -0000 1.6 *************** *** 360,364 **** for (p = string; *p != '\0'; p++) { ! if (!isalnum(*p) && *p != ':' && (*p != '.' || (p[0] == '.' && p[1] == '.'))) { --- 360,364 ---- for (p = string; *p != '\0'; p++) { ! if (!isalnum(UCHAR(*p)) && *p != ':' && (*p != '.' || (p[0] == '.' && p[1] == '.'))) { Index: pathname.c =================================================================== RCS file: /cvsroot/naviserver/naviserver/nsd/pathname.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** pathname.c 13 Jun 2005 01:55:14 -0000 1.5 --- pathname.c 19 Aug 2005 08:20:27 -0000 1.6 *************** *** 39,43 **** NS_RCSID("@(#) $Header$"); ! #define isslash(c) ((c) == '/' || (c) == '\\') /* --- 39,43 ---- NS_RCSID("@(#) $Header$"); ! #define ISSLASH(c) ((c) == '/' || (c) == '\\') /* *************** *** 72,80 **** { #ifdef _WIN32 ! if (isalpha(*path) && path[1] == ':') { path += 2; } #endif ! if (isslash(*path)) { return NS_TRUE; } --- 72,80 ---- { #ifdef _WIN32 ! if (isalpha(UCHAR(*path)) && path[1] == ':') { path += 2; } #endif ! if (ISSLASH(*path)) { return NS_TRUE; } *************** *** 109,114 **** src = Ns_DStringAppend(&tmp, path); #ifdef _WIN32 ! if (isalpha(*src) && src[1] == ':') { ! if (isupper(*src)) { *src = tolower(*src); } --- 109,114 ---- src = Ns_DStringAppend(&tmp, path); #ifdef _WIN32 ! if (isalpha(UCHAR(*src)) && src[1] == ':') { ! if (isupper(UCHAR(*src))) { *src = tolower(*src); } *************** *** 122,126 **** */ ! while (isslash(*src)) { ++src; } --- 122,126 ---- */ ! while (ISSLASH(*src)) { ++src; } *************** *** 132,136 **** */ ! while (*src && !isslash(*src)) { ++src; } --- 132,136 ---- */ ! while (*src && !ISSLASH(*src)) { ++src; } *************** *** 237,241 **** Ns_DStringNAppend(dest, "/", 1); } ! while (*p == '.' || isslash(*p)) { ++p; } --- 237,241 ---- Ns_DStringNAppend(dest, "/", 1); } ! while (*p == '.' || ISSLASH(*p)) { ++p; } *************** *** 736,740 **** while ((s = va_arg(*pap, char *)) != NULL) { ! if (isalpha(*s) && s[1] == ':') { char temp = *(s+2); *(s + 2) = 0; --- 736,740 ---- while ((s = va_arg(*pap, char *)) != NULL) { ! if (isalpha(UCHAR(*s)) && s[1] == ':') { char temp = *(s+2); *(s + 2) = 0; *************** *** 744,748 **** } while (*s) { ! while (isslash(*s)) { ++s; } --- 744,748 ---- } while (*s) { ! while (ISSLASH(*s)) { ++s; } *************** *** 750,754 **** Ns_DStringNAppend(dest, "/", 1); len = 0; ! while (s[len] != '\0' && !isslash(s[len])) { ++len; } --- 750,754 ---- Ns_DStringNAppend(dest, "/", 1); len = 0; ! while (s[len] != '\0' && !ISSLASH(s[len])) { ++len; } |