Date: Tue, 19 Oct 2010 21:04:45 +0000 (UTC) From: Edwin Groothuis <edwin@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org Subject: svn commit: r214079 - stable/8/lib/libc/stdtime Message-ID: <201010192104.o9JL4j5w027126@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: edwin Date: Tue Oct 19 21:04:45 2010 New Revision: 214079 URL: http://svn.freebsd.org/changeset/base/214079 Log: MFC of r207830 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> Modified: stable/8/lib/libc/stdtime/strptime.c Directory Properties: stable/8/lib/libc/ (props changed) stable/8/lib/libc/locale/ (props changed) stable/8/lib/libc/stdtime/ (props changed) stable/8/lib/libc/sys/ (props changed) Modified: stable/8/lib/libc/stdtime/strptime.c ============================================================================== --- stable/8/lib/libc/stdtime/strptime.c Tue Oct 19 21:02:05 2010 (r214078) +++ stable/8/lib/libc/stdtime/strptime.c Tue Oct 19 21:04:45 2010 (r214079) @@ -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)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201010192104.o9JL4j5w027126>