diff options
author | Jim Meyering <jim@meyering.net> | 1999-04-18 23:17:30 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 1999-04-18 23:17:30 +0000 |
commit | cc7d631369744214303eca3b78dc3003b67d47eb (patch) | |
tree | 5bba6a8a4898bc1f4d0c798674881467668e21d1 /lib | |
parent | 4e8d80cad7466a9cb8b99a0dc3921c832867876e (diff) | |
download | coreutils-cc7d631369744214303eca3b78dc3003b67d47eb.tar.xz |
<stdlib.h>: Include if HAVE_STDLIB_H, since bison 1.27 invokes "free".
(LookupWord, yylex): Don't pass negative char to ctype macros.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/getdate.y | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/getdate.y b/lib/getdate.y index 857433648..3807e2f82 100644 --- a/lib/getdate.y +++ b/lib/getdate.y @@ -28,6 +28,10 @@ #include <stdio.h> #include <ctype.h> +#if HAVE_STDLIB_H +# include <stdlib.h> /* 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 == '+') |