From: Jim Meyering Date: Sun, 18 Apr 1999 23:17:30 +0000 (+0000) Subject: : Include if HAVE_STDLIB_H, since bison 1.27 invokes "free". X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=224dcca3b7698c99f351f94b1f78f151a9030c1b;p=pspp : 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 index 857433648e..3807e2f82c 100644 --- 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 @@ LookupWord (buff) /* 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 @@ LookupWord (buff) } /* 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 @@ LookupWord (buff) static int yylex () { - register char c; + register unsigned char c; register char *p; char buff[20]; int Count; @@ -826,7 +830,7 @@ yylex () for (;;) { - while (ISSPACE (*yyInput)) + while (ISSPACE ((unsigned char) *yyInput)) yyInput++; if (ISDIGIT (c = *yyInput) || c == '-' || c == '+')