Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 9 May 2010 22:01:36 +0000 (UTC)
From:      Edwin Groothuis <edwin@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r207830 - head/lib/libc/stdtime
Message-ID:  <201005092201.o49M1a6F058522@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: edwin
Date: Sun May  9 22:01:35 2010
New Revision: 207830
URL: http://svn.freebsd.org/changeset/base/207830

Log:
  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

Modified:
  head/lib/libc/stdtime/strptime.c

Modified: head/lib/libc/stdtime/strptime.c
==============================================================================
--- head/lib/libc/stdtime/strptime.c	Sun May  9 21:34:05 2010	(r207829)
+++ head/lib/libc/stdtime/strptime.c	Sun May  9 22:01:35 2010	(r207830)
@@ -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?201005092201.o49M1a6F058522>