changeset 13398:fa0b6e3a91f5

1030 strftime "%x" should generate something strptime can parse Reviewed by: Garrett D'Amore <garrett@nexenta.com> Reviewed by: Gary Mills <mills@cc.umanitoba.ca> Reviewed by: Igor Kozhukhov <ikozhukhov@gmail.com> Approved by: Garrett D'Amore <garrett@nexenta.com>
author Gordon Ross <gwr@nexenta.com>
date Mon, 11 Jul 2011 16:32:19 -0400
parents edfb98e65b97
children a1d28d03839f
files usr/src/lib/libc/port/locale/strptime.c
diffstat 1 files changed, 9 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/usr/src/lib/libc/port/locale/strptime.c	Mon Jul 11 07:38:13 2011 -0700
+++ b/usr/src/lib/libc/port/locale/strptime.c	Mon Jul 11 16:32:19 2011 -0400
@@ -1,5 +1,5 @@
 /*
- * Copyright 2010, Nexenta Systems, Inc.  All rights reserved.
+ * Copyright 2011, Nexenta Systems, Inc.  All rights reserved.
  * Copyright (c) 1994 Powerdog Industries.  All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -339,8 +339,15 @@
 					ptr++;
 			break;
 
+		case 'e':
+			/*
+			 * The %e format has a space before single digits
+			 * which we need to skip.
+			 */
+			if (isspace(*buf))
+				buf++;
+			/* FALLTHROUGH */
 		case 'd':
-		case 'e':
 			/*
 			 * The %e specifier is explicitly documented as not
 			 * being zero-padded but there is no harm in allowing