# HG changeset patch # User Gordon Ross # Date 1310416339 14400 # Node ID fa0b6e3a91f54303dfce49ebc001e684a1c5a698 # Parent edfb98e65b97913776f448e143e066924d7af309 1030 strftime "%x" should generate something strptime can parse Reviewed by: Garrett D'Amore Reviewed by: Gary Mills Reviewed by: Igor Kozhukhov Approved by: Garrett D'Amore diff -r edfb98e65b97 -r fa0b6e3a91f5 usr/src/lib/libc/port/locale/strptime.c --- 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