svn commit: r214079 - stable/8/lib/libc/stdtime

Edwin Groothuis edwin at FreeBSD.org
Tue Oct 19 21:04:45 UTC 2010


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 at 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)


More information about the svn-src-stable-8 mailing list