diff options
author | Andrew Tridgell <tridge@samba.org> | 2005-07-13 00:47:54 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:22:58 -0500 |
commit | 74727243cd10e5cdf02fb133dbbbe7c213cfda63 (patch) | |
tree | e821479b75c20c4e2f2d0f84e30af5a9d426e6ff | |
parent | 8fc8fa2ad4e38751205afc089c957d38e5fc9384 (diff) | |
download | samba-74727243cd10e5cdf02fb133dbbbe7c213cfda63.tar.gz samba-74727243cd10e5cdf02fb133dbbbe7c213cfda63.tar.bz2 samba-74727243cd10e5cdf02fb133dbbbe7c213cfda63.zip |
r8405: update var.c from upstream
(This used to be commit 288c178d5fef80947590fd58e3c9b1fbcdddcdf6)
-rw-r--r-- | source4/lib/appweb/mpr/var.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/source4/lib/appweb/mpr/var.c b/source4/lib/appweb/mpr/var.c index 9d2afe5306..533248dd06 100644 --- a/source4/lib/appweb/mpr/var.c +++ b/source4/lib/appweb/mpr/var.c @@ -1711,11 +1711,13 @@ void mprVarToString(char** out, int size, char *fmt, MprVar *obj) MprVar mprParseVar(char *buf, MprType preferredType) { - MprType type = MPR_TYPE_UNDEFINED; + MprType type; char *cp; mprAssert(buf); + type = preferredType; + if (preferredType == MPR_TYPE_UNDEFINED) { if (*buf == '-') { type = MPR_NUM_VAR; @@ -1730,18 +1732,18 @@ MprVar mprParseVar(char *buf, MprType preferredType) } else if (isdigit((int) *buf)) { type = MPR_NUM_VAR; cp = buf; - if (*cp && tolower((unsigned char)cp[1]) == 'x') { + if (*cp && tolower(cp[1]) == 'x') { cp = &cp[2]; } for (cp = buf; *cp; cp++) { - if (! isdigit((unsigned char) *cp)) { + if (! isdigit((int) *cp)) { break; } } if (*cp != '\0') { #if BLD_FEATURE_FLOATING_POINT - if (*cp == '.' || tolower((unsigned char)*cp) == 'e') { + if (*cp == '.' || tolower(*cp) == 'e') { type = MPR_TYPE_FLOAT; } else #endif @@ -1750,8 +1752,6 @@ MprVar mprParseVar(char *buf, MprType preferredType) } } } - } else { - type = preferredType; } switch (type) { @@ -1993,11 +1993,11 @@ int64 mprParseInteger64(char *str) } } else { cp++; - if (tolower((unsigned char)*cp) == 'x') { + if (tolower(*cp) == 'x') { cp++; radix = 16; while (*cp) { - c = tolower((unsigned char)*cp); + c = tolower(*cp); if (isdigit(c)) { num64 = (c - '0') + (num64 * radix); } else if (c >= 'a' && c <= 'f') { @@ -2011,7 +2011,7 @@ int64 mprParseInteger64(char *str) } else{ radix = 8; while (*cp) { - c = tolower((unsigned char)*cp); + c = tolower(*cp); if (isdigit(c) && c < '8') { num64 = (c - '0') + (num64 * radix); } else { @@ -2110,11 +2110,11 @@ int mprParseInteger(char *str) } } else { cp++; - if (tolower((unsigned char)*cp) == 'x') { + if (tolower(*cp) == 'x') { cp++; radix = 16; while (*cp) { - c = tolower((unsigned char)*cp); + c = tolower(*cp); if (isdigit(c)) { num = (c - '0') + (num * radix); } else if (c >= 'a' && c <= 'f') { @@ -2128,7 +2128,7 @@ int mprParseInteger(char *str) } else{ radix = 8; while (*cp) { - c = tolower((unsigned char)*cp); + c = tolower(*cp); if (isdigit(c) && c < '8') { num = (c - '0') + (num * radix); } else { |