Also fixed some incorrect type cast.
Fore more details see this squid-dev thread:
http://www.squid-cache.org/mail-archive/squid-dev/200703/0129.html
const unsigned char *p = (const unsigned char *) user;
/* Leading whitespace? */
- if (isspace(p[0]))
+ if (xisspace(p[0]))
return 0;
while (p[0] && p[1]) {
- if (isspace(p[0])) {
+ if (xisspace(p[0])) {
/* More than one consequitive space? */
- if (isspace(p[1]))
+ if (xisspace(p[1]))
return 0;
/* or odd space type character used? */
if (p[0] != ' ')
p++;
}
/* Trailing whitespace? */
- if (isspace(p[0]))
+ if (xisspace(p[0]))
return 0;
return 1;
}
/*
- * $Id: check_group.c,v 1.6 2006/05/05 12:44:26 robertc Exp $
+ * $Id: check_group.c,v 1.7 2007/04/06 12:15:45 serassio Exp $
*
* This is a helper for the external ACL interface for Squid Cache
* Copyright (C) 2002 Rodrigo Albani de Campos (rodrigo@geekbunker.org)
}
break;
case '?':
- if (isprint(optopt)) {
+ if (xisprint(optopt)) {
fprintf(stderr, "Unknown option '-%c'.\n", optopt);
} else {
}
c = *p;
- if (isalnum(c) == 0) {
+ if (xisalnum(c) == 0) {
c = '.';
}
{
char *p = string, c;
while ((c = *p)) {
- *p = toupper(c);
+ *p = xtoupper(c);
p++;
}
}
{
char *p = string, c;
while ((c = *p)) {
- *p = tolower(c);
+ *p = xtolower(c);
p++;
}
}
(int) (p - (unsigned char *) data));
}
c = *p;
- if (isalnum(c) == 0) {
+ if (xisalnum(c) == 0) {
c = '.';
}
/* store hex str (for left side) */
d = buf;
for (; l; l--) {
- if (*sc == '\0' || !isprint((int) (unsigned char) *sc)) {
+ if (*sc == '\0' || !xisprint(*sc)) {
fprintf(stderr, "ntlmGetString: bad ascii: %04x\n", *sc);
return (NULL);
}
}
c = *p;
- if (isalnum(c) == 0) {
+ if (xisalnum(c) == 0) {
c = '.';
}
{
char *p = string, c;
while ((c = *p)) {
- *p = toupper(c);
+ *p = xtoupper(c);
p++;
}
}
{
char *p = string, c;
while ((c = *p)) {
- *p = tolower(c);
+ *p = xtolower(c);
p++;
}
}
/*
- * $Id: util.c,v 1.94 2006/08/02 22:06:35 hno Exp $
+ * $Id: util.c,v 1.95 2007/04/06 12:15:51 serassio Exp $
*
* DEBUG:
* AUTHOR: Harvest Derived
char *s = q;
while (*s) {
- *s = tolower((unsigned char) *s);
+ *s = xtolower(*s);
s++;
}
}
/*
- * $Id: HttpMsg.cc,v 1.40 2007/04/06 04:50:04 rousskov Exp $
+ * $Id: HttpMsg.cc,v 1.41 2007/04/06 12:15:51 serassio Exp $
*
* DEBUG: section 74 HTTP Message
* AUTHOR: Alex Rousskov
i = 0;
/* Find first non-whitespace - beginning of method */
- for (; i < hmsg->req_end && (isspace(hmsg->buf[i])); i++);
+ for (; i < hmsg->req_end && (xisspace(hmsg->buf[i])); i++);
if (i >= hmsg->req_end) {
retcode = 0;
goto finish;
hmsg->req_start = i;
/* Find first whitespace - end of method */
- for (; i < hmsg->req_end && (! isspace(hmsg->buf[i])); i++);
+ for (; i < hmsg->req_end && (! xisspace(hmsg->buf[i])); i++);
if (i >= hmsg->req_end) {
retcode = 0;
goto finish;
hmsg->m_end = i - 1;
/* Find first non-whitespace - beginning of URL+Version */
- for (; i < hmsg->req_end && (isspace(hmsg->buf[i])); i++);
+ for (; i < hmsg->req_end && (xisspace(hmsg->buf[i])); i++);
if (i >= hmsg->req_end) {
retcode = 0;
goto finish;
} else {
/* Find the first non-whitespace after last_whitespace */
/* XXX why <= vs < ? I do need to really re-audit all of this ..*/
- for (i = last_whitespace; i <= hmsg->req_end && isspace(hmsg->buf[i]); i++);
+ for (i = last_whitespace; i <= hmsg->req_end && xisspace(hmsg->buf[i]); i++);
if (i > hmsg->req_end) {
retcode = 0;
goto finish;
if (size == 0 && p && *p++ == ';') {
const char *e = theIn->content() + crlfBeg; // end of extension
- while (p < e && isspace(*p))
+ while (p < e && xisspace(*p))
++p; // skip space
sawIeof = e - p >= 4 &&
strncmp(p, "ieof", 4) == 0 &&
- isspace(p[4]);
+ xisspace(p[4]);
}
theIn->consume(crlfEnd);
/*
- * $Id: String.cc,v 1.22 2006/09/28 07:33:59 adrian Exp $
+ * $Id: String.cc,v 1.23 2007/04/06 12:15:51 serassio Exp $
*
* DEBUG: section 67 String
* AUTHOR: Duane Wessels
if (!p)
goto error;
- while (*p && isspace(*p))
+ while (*p && xisspace(*p))
p++;
if (!*p)
break;
default:
- if (!quoted && isspace(*p)) {
+ if (!quoted && xisspace(*p)) {
p++;
goto done;
}
/*
- * $Id: cache_cf.cc,v 1.505 2007/02/25 11:32:29 hno Exp $
+ * $Id: cache_cf.cc,v 1.506 2007/04/06 12:15:51 serassio Exp $
*
* DEBUG: section 3 Configuration File Parsing
* AUTHOR: Harvest Derived
if (file == token)
continue; /* Not a valid #line directive, may be a comment */
- while (*file && isspace((unsigned char) *file))
+ while (*file && xisspace((unsigned char) *file))
file++;
if (*file) {
if (token == NULL)
self_destruct();
- while (*token && isspace(*token))
+ while (*token && xisspace(*token))
token++;
if (!*token)
/*
- * $Id: external_acl.cc,v 1.74 2006/08/21 00:50:41 robertc Exp $
+ * $Id: external_acl.cc,v 1.75 2007/04/06 12:15:51 serassio Exp $
*
* DEBUG: section 82 External ACL
* AUTHOR: Henrik Nordstrom, MARA Systems AB
/* Split in header and member */
*member++ = '\0';
- if (!isalnum(*member))
+ if (!xisalnum(*member))
format->separator = *member++;
else
format->separator = ',';
/*
- * $Id: ftp.cc,v 1.410 2007/04/06 04:50:06 rousskov Exp $
+ * $Id: ftp.cc,v 1.411 2007/04/06 12:15:51 serassio Exp $
*
* DEBUG: section 9 File Transfer Protocol (FTP)
* AUTHOR: Harvest Derived
if ((t = request->urlpath.rpos(';')) != NULL) {
if (strncasecmp(t + 1, "type=", 5) == 0) {
- typecode = (char) toupper((int) *(t + 6));
+ typecode = (char) xtoupper(*(t + 6));
request->urlpath.cutPointer(t);
}
}
/*
- * $Id: helper.cc,v 1.78 2006/09/19 07:56:57 adrian Exp $
+ * $Id: helper.cc,v 1.79 2007/04/06 12:15:51 serassio Exp $
*
* DEBUG: section 84 Helper process maintenance
* AUTHOR: Harvest Derived?
if (hlp->concurrency) {
i = strtol(msg, &msg, 10);
- while (*msg && isspace(*msg))
+ while (*msg && xisspace(*msg))
msg++;
}
/*
- * $Id: http.cc,v 1.511 2007/04/06 04:50:06 rousskov Exp $
+ * $Id: http.cc,v 1.512 2007/04/06 12:15:51 serassio Exp $
*
* DEBUG: section 11 Hypertext Transfer Protocol (HTTP)
* AUTHOR: Harvest Derived
if (!flags.headers_parsed && flag == COMM_OK && len > 0 && fd_table[fd].uses > 1) {
/* Skip whitespace between replies */
- while (len > 0 && isspace(*buf))
+ while (len > 0 && xisspace(*buf))
xmemmove(buf, buf + 1, len--);
if (len == 0) {
/*
- * $Id: stub_cache_cf.cc,v 1.3 2006/04/23 11:10:35 robertc Exp $
+ * $Id: stub_cache_cf.cc,v 1.4 2007/04/06 12:15:52 serassio Exp $
*
* DEBUG: section 3 Configuration File Parsing
* AUTHOR: Robert Collins
if (token == NULL)
self_destruct();
- while (*token && isspace(*token))
+ while (*token && xisspace(*token))
token++;
if (!*token)
for (t = buf; t < end; t += strcspn(t, crlf), t += strspn(t, crlf)) {
if (strncasecmp(t, hdr, strlen(hdr)) == 0) {
t += strlen(hdr);
- while (isspace(*t))
+ while (xisspace(*t))
t++;
return atoi(t);
}
for (t = buf; t < end; t += strcspn(t, crlf), t += strspn(t, crlf)) {
if (strncasecmp(t, hdr, strlen(hdr)) == 0) {
t += strlen(hdr);
- while (isspace(*t))
+ while (xisspace(*t))
t++;
strcpy(result, "");
strncat(result, t, strcspn(t, crlf));