mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-04 12:52:15 +00:00
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
This commit is contained in:
parent
757b9a68d7
commit
3d74e220a5
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=207830
@ -408,6 +408,14 @@ _strptime(const char *buf, const char *fmt, struct tm *tm, int *GMTp)
|
||||
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)
|
||||
|
Loading…
Reference in New Issue
Block a user