summaryrefslogtreecommitdiff
path: root/lib/getdate.y
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2006-07-09 16:59:05 +0000
committerPaul Eggert <eggert@cs.ucla.edu>2006-07-09 16:59:05 +0000
commitcb052e4f6cc723bc408f32963e921705f3286c94 (patch)
treed6f6172f7cff8f5c44f9ae557a525e4b1baf277b /lib/getdate.y
parent28edf6a75ef4f95e18da5b506bdcf122a53ca3ec (diff)
downloadcoreutils-cb052e4f6cc723bc408f32963e921705f3286c94.tar.xz
Update from gnulib.
Diffstat (limited to 'lib/getdate.y')
-rw-r--r--lib/getdate.y26
1 files changed, 8 insertions, 18 deletions
diff --git a/lib/getdate.y b/lib/getdate.y
index 018504825..d874d689e 100644
--- a/lib/getdate.y
+++ b/lib/getdate.y
@@ -68,19 +68,10 @@
#include "setenv.h"
#include "xalloc.h"
-#if STDC_HEADERS || (! defined isascii && ! HAVE_ISASCII)
-# define IN_CTYPE_DOMAIN(c) 1
-#else
-# define IN_CTYPE_DOMAIN(c) isascii (c)
-#endif
-
-#define ISSPACE(c) (IN_CTYPE_DOMAIN (c) && isspace (c))
-#define ISALPHA(c) (IN_CTYPE_DOMAIN (c) && isalpha (c))
-#define ISLOWER(c) (IN_CTYPE_DOMAIN (c) && islower (c))
/* ISDIGIT differs from isdigit, as follows:
- - Its arg may be any int or unsigned int; it need not be an unsigned char.
- - It's guaranteed to evaluate its argument exactly once.
+ - Its arg may be any int or unsigned int; it need not be an unsigned char
+ or EOF.
- It's typically faster.
POSIX says that only '0' through '9' are digits. Prefer ISDIGIT to
isdigit unless it's important to use the locale's definition
@@ -896,8 +887,7 @@ lookup_word (parser_control const *pc, char *word)
for (p = word; *p; p++)
{
unsigned char ch = *p;
- if (ISLOWER (ch))
- *p = toupper (ch);
+ *p = toupper (ch);
}
for (tp = meridian_table; tp->name; tp++)
@@ -962,7 +952,7 @@ yylex (YYSTYPE *lvalp, parser_control *pc)
for (;;)
{
- while (c = *pc->input, ISSPACE (c))
+ while (c = *pc->input, isspace (c))
pc->input++;
if (ISDIGIT (c) || c == '-' || c == '+')
@@ -973,7 +963,7 @@ yylex (YYSTYPE *lvalp, parser_control *pc)
if (c == '-' || c == '+')
{
sign = c == '-' ? -1 : 1;
- while (c = *++pc->input, ISSPACE (c))
+ while (c = *++pc->input, isspace (c))
continue;
if (! ISDIGIT (c))
/* skip the '-' sign */
@@ -1077,7 +1067,7 @@ yylex (YYSTYPE *lvalp, parser_control *pc)
}
}
- if (ISALPHA (c))
+ if (isalpha (c))
{
char buff[20];
char *p = buff;
@@ -1089,7 +1079,7 @@ yylex (YYSTYPE *lvalp, parser_control *pc)
*p++ = c;
c = *++pc->input;
}
- while (ISALPHA (c) || c == '.');
+ while (isalpha (c) || c == '.');
*p = '\0';
tp = lookup_word (pc, buff);
@@ -1201,7 +1191,7 @@ get_date (struct timespec *result, char const *p, struct timespec const *now)
if (! tmp)
return false;
- while (c = *p, ISSPACE (c))
+ while (c = *p, isspace (c))
p++;
if (strncmp (p, "TZ=\"", 4) == 0)