diff options
author | NAKAMURA Takumi <geek4civic@gmail.com> | 2013-07-12 02:13:03 +0000 |
---|---|---|
committer | NAKAMURA Takumi <geek4civic@gmail.com> | 2013-07-12 02:13:03 +0000 |
commit | 99a8b548402de834d72dfa34ab18e7c22d0346f7 (patch) | |
tree | 18122aeaa2d77188a79ad8760830020109812478 | |
parent | da07e9df843015f8c306ed7863dbb8c8055fd85f (diff) | |
download | external_llvm-99a8b548402de834d72dfa34ab18e7c22d0346f7.zip external_llvm-99a8b548402de834d72dfa34ab18e7c22d0346f7.tar.gz external_llvm-99a8b548402de834d72dfa34ab18e7c22d0346f7.tar.bz2 |
Windows/TimeValue.inc: Mute prefixed '0' on %d to emulate %e.
It fixes compatibility in llvm/test/Object/archive-toc.test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186142 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Support/Windows/TimeValue.inc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/Support/Windows/TimeValue.inc b/lib/Support/Windows/TimeValue.inc index 4850229..96f5579 100644 --- a/lib/Support/Windows/TimeValue.inc +++ b/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); } |