4
0
mirror of git://sourceware.org/git/newlib-cygwin.git synced 2025-01-31 11:30:56 +08:00

* libc/minires.c (scanline): Accommodate ctype changes which disallow use of an

unadorned char argument to is* macros.
* regex/regcomp.c: Ditto, throughout.
* regex/regex2.h (ISWORD): Ditto.
This commit is contained in:
Christopher Faylor 2009-05-04 04:30:37 +00:00
parent b65ec404a7
commit b7a1552440
4 changed files with 17 additions and 10 deletions

View File

@ -1,3 +1,10 @@
2009-05-04 Christopher Faylor <me+cygwin@cgf.cx>
* libc/minires.c (scanline): Accommodate ctype changes which disallow
use of an unadorned char argument to is* macros.
* regex/regcomp.c: Ditto, throughout.
* regex/regex2.h (ISWORD): Ditto.
2009-05-03 Christopher Faylor <me+cygwin@cgf.cx> 2009-05-03 Christopher Faylor <me+cygwin@cgf.cx>
* fhandler.h (fhandler_console::MAX_WRITE_CHARS): Declare. * fhandler.h (fhandler_console::MAX_WRITE_CHARS): Declare.

View File

@ -43,11 +43,11 @@ static int scanline(char * in, char **list, int * sizes, int maxnum)
int i; int i;
char * startp; char * startp;
for (i = 0; i < maxnum; i++) { for (i = 0; i < maxnum; i++) {
while((*in) && (isspace(*in) || *in == ',')) in++; while((*in) && (isspace((unsigned)*in) || *in == ',')) in++;
if (*in == 0) if (*in == 0)
break; break;
startp = in++; startp = in++;
while((*in) && !isspace(*in) && *in != ',') in++; while((*in) && !isspace((unsigned)*in) && *in != ',') in++;
list[i] = startp; list[i] = startp;
sizes[i] = in - startp + 1; sizes[i] = in - startp + 1;
if (*in) if (*in)

View File

@ -311,7 +311,7 @@ register struct parse *p;
ordinary(p, c); ordinary(p, c);
break; break;
case '{': /* okay as ordinary except if digit follows */ case '{': /* okay as ordinary except if digit follows */
REQUIRE(!MORE() || !isdigit(PEEK()), REG_BADRPT); REQUIRE(!MORE() || !isdigit((unsigned)PEEK()), REG_BADRPT);
/* FALLTHROUGH */ /* FALLTHROUGH */
default: default:
ordinary(p, c); ordinary(p, c);
@ -323,7 +323,7 @@ register struct parse *p;
c = PEEK(); c = PEEK();
/* we call { a repetition if followed by a digit */ /* we call { a repetition if followed by a digit */
if (!( c == '*' || c == '+' || c == '?' || if (!( c == '*' || c == '+' || c == '?' ||
(c == '{' && MORE2() && isdigit(PEEK2())) )) (c == '{' && MORE2() && isdigit((unsigned)PEEK2())) ))
return; /* no repetition, we're done */ return; /* no repetition, we're done */
NEXT(); NEXT();
@ -352,7 +352,7 @@ register struct parse *p;
case '{': case '{':
count = p_count(p); count = p_count(p);
if (EAT(',')) { if (EAT(',')) {
if (isdigit(PEEK())) { if (isdigit((unsigned)PEEK())) {
count2 = p_count(p); count2 = p_count(p);
REQUIRE(count <= count2, REG_BADBR); REQUIRE(count <= count2, REG_BADBR);
} else /* single number with comma */ } else /* single number with comma */
@ -373,7 +373,7 @@ register struct parse *p;
return; return;
c = PEEK(); c = PEEK();
if (!( c == '*' || c == '+' || c == '?' || if (!( c == '*' || c == '+' || c == '?' ||
(c == '{' && MORE2() && isdigit(PEEK2())) ) ) (c == '{' && MORE2() && isdigit((unsigned)PEEK2())) ) )
return; return;
SETERROR(REG_BADRPT); SETERROR(REG_BADRPT);
} }
@ -530,7 +530,7 @@ int starordinary; /* is a leading * an ordinary character? */
} else if (EATTWO('\\', '{')) { } else if (EATTWO('\\', '{')) {
count = p_count(p); count = p_count(p);
if (EAT(',')) { if (EAT(',')) {
if (MORE() && isdigit(PEEK())) { if (MORE() && isdigit((unsigned)PEEK())) {
count2 = p_count(p); count2 = p_count(p);
REQUIRE(count <= count2, REG_BADBR); REQUIRE(count <= count2, REG_BADBR);
} else /* single number with comma */ } else /* single number with comma */
@ -561,7 +561,7 @@ register struct parse *p;
register int count = 0; register int count = 0;
register int ndigits = 0; register int ndigits = 0;
while (MORE() && isdigit(PEEK()) && count <= DUPMAX) { while (MORE() && isdigit((unsigned)PEEK()) && count <= DUPMAX) {
count = count*10 + (GETNEXT() - '0'); count = count*10 + (GETNEXT() - '0');
ndigits++; ndigits++;
} }
@ -728,7 +728,7 @@ register cset *cs;
register const char *u; register const char *u;
register char c; register char c;
while (MORE() && isalpha(PEEK())) while (MORE() && isalpha((unsigned)PEEK()))
NEXT(); NEXT();
len = p->next - sp; len = p->next - sp;
for (cp = cclasses; cp->name != NULL; cp++) for (cp = cclasses; cp->name != NULL; cp++)

View File

@ -131,4 +131,4 @@ struct re_guts {
/* misc utilities */ /* misc utilities */
#define OUT (CHAR_MAX+1) /* a non-character value */ #define OUT (CHAR_MAX+1) /* a non-character value */
#define ISWORD(c) (isalnum(c) || (c) == '_') #define ISWORD(c) (isalnum((unsigned)c) || (c) == '_')