summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNAKAMURA Takumi <geek4civic@gmail.com>2013-07-12 02:13:03 +0000
committerNAKAMURA Takumi <geek4civic@gmail.com>2013-07-12 02:13:03 +0000
commit40bd28a7df47acc7ceadfea7eae6dc3441c406cc (patch)
treef4075e39ef2cee19d5077c4a4744428e4e2a7070
parent30d6865a234a0f12f923d7d28f17e4418ee6742c (diff)
downloadbcm5719-llvm-40bd28a7df47acc7ceadfea7eae6dc3441c406cc.tar.gz
bcm5719-llvm-40bd28a7df47acc7ceadfea7eae6dc3441c406cc.zip
Windows/TimeValue.inc: Mute prefixed '0' on %d to emulate %e.
It fixes compatibility in llvm/test/Object/archive-toc.test. llvm-svn: 186142
-rw-r--r--llvm/lib/Support/Windows/TimeValue.inc5
1 files changed, 5 insertions, 0 deletions
diff --git a/llvm/lib/Support/Windows/TimeValue.inc b/llvm/lib/Support/Windows/TimeValue.inc
index 485022929b2..96f55797e53 100644
--- a/llvm/lib/Support/Windows/TimeValue.inc
+++ b/llvm/lib/Support/Windows/TimeValue.inc
@@ -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);
}
OpenPOWER on IntegriCloud