[llvm] r186142 - Windows/TimeValue.inc: Mute prefixed '0' on %d to emulate %e.
NAKAMURA Takumi
geek4civic at gmail.com
Thu Jul 11 19:13:04 PDT 2013
Author: chapuni
Date: Thu Jul 11 21:13:03 2013
New Revision: 186142
URL: http://llvm.org/viewvc/llvm-project?rev=186142&view=rev
Log:
Windows/TimeValue.inc: Mute prefixed '0' on %d to emulate %e.
It fixes compatibility in llvm/test/Object/archive-toc.test.
Modified:
llvm/trunk/lib/Support/Windows/TimeValue.inc
Modified: llvm/trunk/lib/Support/Windows/TimeValue.inc
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Windows/TimeValue.inc?rev=186142&r1=186141&r2=186142&view=diff
==============================================================================
--- llvm/trunk/lib/Support/Windows/TimeValue.inc (original)
+++ llvm/trunk/lib/Support/Windows/TimeValue.inc Thu Jul 11 21:13:03 2013
@@ -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);
}
More information about the llvm-commits
mailing list