# HG changeset patch # User Jim Meyering # Date 924477450 0 # Node ID 197f4bdf9a3d75ff476226e96c7b4bab54d8a74b # Parent 5afbb5279fd5c0f3e5d3875f6cc61f4887c3687d : Include if HAVE_STDLIB_H, since bison 1.27 invokes "free". (LookupWord, yylex): Don't pass negative char to ctype macros. diff --git a/lib/getdate.y b/lib/getdate.y --- a/lib/getdate.y +++ b/lib/getdate.y @@ -28,6 +28,10 @@ #include #include +#if HAVE_STDLIB_H +# include /* for `free'; used by Bison 1.27 */ +#endif + #if defined (STDC_HEADERS) || (!defined (isascii) && !defined (HAVE_ISASCII)) # define IN_CTYPE_DOMAIN(c) 1 #else @@ -706,7 +710,7 @@ /* Make it lowercase. */ for (p = buff; *p; p++) - if (ISUPPER (*p)) + if (ISUPPER ((unsigned char) *p)) *p = tolower (*p); if (strcmp (buff, "am") == 0 || strcmp (buff, "a.m.") == 0) @@ -787,7 +791,7 @@ } /* Military timezones. */ - if (buff[1] == '\0' && ISALPHA (*buff)) + if (buff[1] == '\0' && ISALPHA ((unsigned char) *buff)) { for (tp = MilitaryTable; tp->name; tp++) if (strcmp (buff, tp->name) == 0) @@ -818,7 +822,7 @@ static int yylex () { - register char c; + register unsigned char c; register char *p; char buff[20]; int Count; @@ -826,7 +830,7 @@ for (;;) { - while (ISSPACE (*yyInput)) + while (ISSPACE ((unsigned char) *yyInput)) yyInput++; if (ISDIGIT (c = *yyInput) || c == '-' || c == '+')