Windows/TimeValue.inc: Mute prefixed '0' on %d to emulate %e.

It fixes compatibility in llvm/test/Object/archive-toc.test.

llvm-svn: 186142
This commit is contained in:
NAKAMURA Takumi 2013-07-12 02:13:03 +00:00
parent 30d6865a23
commit 40bd28a7df
1 changed files with 5 additions and 0 deletions

View File

@ -49,6 +49,11 @@ std::string TimeValue::str() const {
char Buffer[25];
// FIXME: the windows version of strftime doesn't support %e
strftime(Buffer, 25, "%b %d %H:%M %Y", LT);
assert((Buffer[3] == ' ' && isdigit(Buffer[5]) && Buffer[6] == ' ') ||
"Unexpected format in strftime()!");
// Emulate %e on %d to mute '0'.
if (Buffer[4] == '0')
Buffer[4] = ' ';
return std::string(Buffer);
}