Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 19 Oct 2010 21:05:22 +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-7@freebsd.org
Subject:   svn commit: r214080 - stable/7/lib/libc/stdtime
Message-ID:  <201010192105.o9JL5Nep027189@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: edwin
Date: Tue Oct 19 21:05:22 2010
New Revision: 214080
URL: http://svn.freebsd.org/changeset/base/214080

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/7/lib/libc/stdtime/strptime.c
Directory Properties:
  stable/7/lib/libc/   (props changed)
  stable/7/lib/libc/stdtime/   (props changed)

Modified: stable/7/lib/libc/stdtime/strptime.c
==============================================================================
--- stable/7/lib/libc/stdtime/strptime.c	Tue Oct 19 21:04:45 2010	(r214079)
+++ stable/7/lib/libc/stdtime/strptime.c	Tue Oct 19 21:05:22 2010	(r214080)
@@ -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?201010192105.o9JL5Nep027189>