diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2009-05-06 12:03:34 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2009-05-06 12:03:34 +0000 |
commit | eed691a929c282b1f85799c63e05667087054771 (patch) | |
tree | a21e4d62375c419a5782714336636e09499a5621 | |
parent | e1de7bfabdcc0a5530b9f16cbf4c6bfb2b47b506 (diff) | |
download | newlib-eed691a929c282b1f85799c63e05667087054771.zip newlib-eed691a929c282b1f85799c63e05667087054771.tar.gz newlib-eed691a929c282b1f85799c63e05667087054771.tar.bz2 |
* libc/minires.c (scanline): Fix type in calls to ctype functions
to stay in unsigned char range for char values >= 0x80.
* regex/regcomp.c: Ditto, throughout.
* regex/regex2.h (ISWORD): Ditto.
-rw-r--r-- | winsup/cygwin/ChangeLog | 7 | ||||
-rw-r--r-- | winsup/cygwin/libc/minires.c | 4 | ||||
-rw-r--r-- | winsup/cygwin/regex/regcomp.c | 14 | ||||
-rw-r--r-- | winsup/cygwin/regex/regex2.h | 2 |
4 files changed, 17 insertions, 10 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 3374f58..8da30a4 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,5 +1,12 @@ 2009-05-06 Corinna Vinschen <corinna@vinschen.de> + * libc/minires.c (scanline): Fix type in calls to ctype functions + to stay in unsigned char range for char values >= 0x80. + * regex/regcomp.c: Ditto, throughout. + * regex/regex2.h (ISWORD): Ditto. + +2009-05-06 Corinna Vinschen <corinna@vinschen.de> + * cygheap.cc (cygheap_init): Set umask to a sane default. * uinfo.cc (cygheap_user::ontherange): Don't use HOMEDRIVE/HOMEPATH to set HOME. Default to /home/USERNAME. diff --git a/winsup/cygwin/libc/minires.c b/winsup/cygwin/libc/minires.c index af7f59f..c401e7c 100644 --- a/winsup/cygwin/libc/minires.c +++ b/winsup/cygwin/libc/minires.c @@ -43,11 +43,11 @@ static int scanline(char * in, char **list, int * sizes, int maxnum) int i; char * startp; for (i = 0; i < maxnum; i++) { - while((*in) && (isspace((unsigned)*in) || *in == ',')) in++; + while((*in) && (isspace((unsigned char)*in) || *in == ',')) in++; if (*in == 0) break; startp = in++; - while((*in) && !isspace((unsigned)*in) && *in != ',') in++; + while((*in) && !isspace((unsigned char)*in) && *in != ',') in++; list[i] = startp; sizes[i] = in - startp + 1; if (*in) diff --git a/winsup/cygwin/regex/regcomp.c b/winsup/cygwin/regex/regcomp.c index db83bbc..f771a1a 100644 --- a/winsup/cygwin/regex/regcomp.c +++ b/winsup/cygwin/regex/regcomp.c @@ -311,7 +311,7 @@ register struct parse *p; ordinary(p, c); break; case '{': /* okay as ordinary except if digit follows */ - REQUIRE(!MORE() || !isdigit((unsigned)PEEK()), REG_BADRPT); + REQUIRE(!MORE() || !isdigit((unsigned char)PEEK()), REG_BADRPT); /* FALLTHROUGH */ default: ordinary(p, c); @@ -323,7 +323,7 @@ register struct parse *p; c = PEEK(); /* we call { a repetition if followed by a digit */ if (!( c == '*' || c == '+' || c == '?' || - (c == '{' && MORE2() && isdigit((unsigned)PEEK2())) )) + (c == '{' && MORE2() && isdigit((unsigned char)PEEK2())) )) return; /* no repetition, we're done */ NEXT(); @@ -352,7 +352,7 @@ register struct parse *p; case '{': count = p_count(p); if (EAT(',')) { - if (isdigit((unsigned)PEEK())) { + if (isdigit((unsigned char)PEEK())) { count2 = p_count(p); REQUIRE(count <= count2, REG_BADBR); } else /* single number with comma */ @@ -373,7 +373,7 @@ register struct parse *p; return; c = PEEK(); if (!( c == '*' || c == '+' || c == '?' || - (c == '{' && MORE2() && isdigit((unsigned)PEEK2())) ) ) + (c == '{' && MORE2() && isdigit((unsigned char)PEEK2())) ) ) return; SETERROR(REG_BADRPT); } @@ -530,7 +530,7 @@ int starordinary; /* is a leading * an ordinary character? */ } else if (EATTWO('\\', '{')) { count = p_count(p); if (EAT(',')) { - if (MORE() && isdigit((unsigned)PEEK())) { + if (MORE() && isdigit((unsigned char)PEEK())) { count2 = p_count(p); REQUIRE(count <= count2, REG_BADBR); } else /* single number with comma */ @@ -561,7 +561,7 @@ register struct parse *p; register int count = 0; register int ndigits = 0; - while (MORE() && isdigit((unsigned)PEEK()) && count <= DUPMAX) { + while (MORE() && isdigit((unsigned char)PEEK()) && count <= DUPMAX) { count = count*10 + (GETNEXT() - '0'); ndigits++; } @@ -728,7 +728,7 @@ register cset *cs; register const char *u; register char c; - while (MORE() && isalpha((unsigned)PEEK())) + while (MORE() && isalpha((unsigned char)PEEK())) NEXT(); len = p->next - sp; for (cp = cclasses; cp->name != NULL; cp++) diff --git a/winsup/cygwin/regex/regex2.h b/winsup/cygwin/regex/regex2.h index be8b2f5..176038a 100644 --- a/winsup/cygwin/regex/regex2.h +++ b/winsup/cygwin/regex/regex2.h @@ -131,4 +131,4 @@ struct re_guts { /* misc utilities */ #define OUT (CHAR_MAX+1) /* a non-character value */ -#define ISWORD(c) (isalnum((unsigned)c) || (c) == '_') +#define ISWORD(c) (isalnum((unsigned char)c) || (c) == '_') |