summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoredwin <edwin@FreeBSD.org>2010-05-09 22:01:35 +0000
committeredwin <edwin@FreeBSD.org>2010-05-09 22:01:35 +0000
commit7bcd31a9585193053fd63b82c0759fdbbf5dd726 (patch)
tree4189b4155f98cf6d409be0916302eb4e57787a7e
parent9dd8f2f4602578705e3f60039055a449f173bfc9 (diff)
downloadFreeBSD-src-7bcd31a9585193053fd63b82c0759fdbbf5dd726.zip
FreeBSD-src-7bcd31a9585193053fd63b82c0759fdbbf5dd726.tar.gz
strptime(3) confused July with June with the fr_FR locale.
When parsing the month "juillet" (abbr "jul"), %B recognized it as "juin" (abbr "jui") because the full name of the month names is checked at the same time as the abbrevation. The new behaviour checks the full names first before checking the abbrevation names. PR: kern/141939 Submitted by: Denis Chatelain <denis@tikuts.com> MFC after: 1 week
-rw-r--r--lib/libc/stdtime/strptime.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/libc/stdtime/strptime.c b/lib/libc/stdtime/strptime.c
index 51d41ed..401350e 100644
--- a/lib/libc/stdtime/strptime.c
+++ b/lib/libc/stdtime/strptime.c
@@ -408,6 +408,14 @@ label:
if (strncasecmp(buf, tptr->month[i],
len) == 0)
break;
+ }
+ }
+ /*
+ * Try the abbreviated month name if the full name
+ * wasn't found and Oalternative was not requested.
+ */
+ if (i == asizeof(tptr->month) && !Oalternative) {
+ for (i = 0; i < asizeof(tptr->month); i++) {
len = strlen(tptr->mon[i]);
if (strncasecmp(buf, tptr->mon[i],
len) == 0)
OpenPOWER on IntegriCloud