+2008-08-02 Jim Meyering <meyering@redhat.com>
+
+ getdate.y: avoid locale-dependent date parsing failure
+ In Turkish locales, getdate would fail to recognize keywords
+ containing a lowercase "i". The solution is not to rely on
+ locale-sensitive case-conversion.
+ * lib/getdate.y: Include <c-ctype.h> rather than <ctype.h>.
+ (lookup_word): Use c_toupper in place of toupper.
+ (yylex, get_date): Use c_ prefixed variants of isspace and isalpha, too.
+ Reported by Vefa Bicakci <bicave@superonline.com> in
+ <http://thread.gmane.org/gmane.comp.gnu.coreutils.bugs/14184>.
+ * modules/getdate (Depends-on): Add c-ctype.
+
2008-08-02 Bruno Haible <bruno@clisp.org>
* gnulib-tool (func_import): When updating or creating a .gitignore
# undef static
#endif
-#include <ctype.h>
+#include <c-ctype.h>
#include <limits.h>
#include <stdio.h>
#include <stdlib.h>
for (p = word; *p; p++)
{
unsigned char ch = *p;
- *p = toupper (ch);
+ *p = c_toupper (ch);
}
for (tp = meridian_table; tp->name; tp++)
for (;;)
{
- while (c = *pc->input, isspace (c))
+ while (c = *pc->input, c_isspace (c))
pc->input++;
if (ISDIGIT (c) || c == '-' || c == '+')
if (c == '-' || c == '+')
{
sign = c == '-' ? -1 : 1;
- while (c = *++pc->input, isspace (c))
+ while (c = *++pc->input, c_isspace (c))
continue;
if (! ISDIGIT (c))
/* skip the '-' sign */
}
}
- if (isalpha (c))
+ if (c_isalpha (c))
{
char buff[20];
char *p = buff;
*p++ = c;
c = *++pc->input;
}
- while (isalpha (c) || c == '.');
+ while (c_isalpha (c) || c == '.');
*p = '\0';
tp = lookup_word (pc, buff);
if (! tmp)
return false;
- while (c = *p, isspace (c))
+ while (c = *p, c_isspace (c))
p++;
if (strncmp (p, "TZ=\"", 4) == 0)