diff options
author | Jim Meyering <jim@meyering.net> | 1996-12-21 01:40:43 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 1996-12-21 01:40:43 +0000 |
commit | 4a2b289e7c27da90ba0ae5300d13eb72a048c51f (patch) | |
tree | c92fcdbaacaf36f09e4e9f2decbe59b694d071cd | |
parent | bab072f3aa271e7d005d4e7433053c9aa80caf56 (diff) | |
download | coreutils-4a2b289e7c27da90ba0ae5300d13eb72a048c51f.tar.xz |
Update from GNU libc.
-rw-r--r-- | lib/strftime.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/strftime.c b/lib/strftime.c index aa8351641..3ae6dec9c 100644 --- a/lib/strftime.c +++ b/lib/strftime.c @@ -230,6 +230,11 @@ static const char spaces[16] = " "; # define TOUPPER(Ch) (islower (Ch) ? toupper (Ch) : (Ch)) # define TOLOWER(Ch) (isupper (Ch) ? tolower (Ch) : (Ch)) #endif +/* We don't use `isdigit' here since the locale dependent + interpretation is not what we want here. We only need to accept + the arabic digits in the ASCII range. One day there is perhaps a + more reliable way to accept other sets of digits. */ +#define ISDIGIT(Ch) ((unsigned int) (Ch) - '0' <= 9) static char *memcpy_lowcase __P ((char *dest, const char *src, size_t len)); @@ -511,15 +516,16 @@ strftime (s, maxsize, format, tp) } /* As a GNU extension we allow to specify the field width. */ - if (isdigit (*f)) + if (ISDIGIT (*f)) { width = 0; do { width *= 10; width += *f - '0'; + ++f; } - while (isdigit (*++f)); + while (ISDIGIT (*f)); } /* Check for modifiers. */ |