diff options
author | Evan Mallory <schmave@gmail.com> | 2016-10-02 20:11:22 -0400 |
---|---|---|
committer | Evan Mallory <schmave@gmail.com> | 2016-10-02 20:11:22 -0400 |
commit | 441cadead34be79a4d1a6bab5a7683b7f7227f3f (patch) | |
tree | 556549e1765d1883e9869d98a41f3d86b27cf37b /src/strptime.cc | |
parent | cd58d43228996198b5ba329f7c05109f2aaee65a (diff) | |
download | fork-ledger-441cadead34be79a4d1a6bab5a7683b7f7227f3f.tar.gz fork-ledger-441cadead34be79a4d1a6bab5a7683b7f7227f3f.tar.bz2 fork-ledger-441cadead34be79a4d1a6bab5a7683b7f7227f3f.zip |
Fix Windows strptime
This fixes the datetime-related tests in testAddition and testSubtraction in the LedgerMathTests
Diffstat (limited to 'src/strptime.cc')
-rw-r--r-- | src/strptime.cc | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/strptime.cc b/src/strptime.cc index b9d485d2..dc08df46 100644 --- a/src/strptime.cc +++ b/src/strptime.cc @@ -70,14 +70,14 @@ static char* _strptime(const char *s, const char *format, struct tm *tm) { case 'A': tm->tm_wday = -1; for (int i = 0; i < 7; ++i) { - len = static_cast<int>(strlen(kWeekAbbr[i])); - if (strnicmp(kWeekAbbr[i], s, len) == 0) { + len = static_cast<int>(strlen(kWeekFull[i])); + if (strnicmp(kWeekFull[i], s, len) == 0) { tm->tm_wday = i; break; } - len = static_cast<int>(strlen(kWeekFull[i])); - if (strnicmp(kWeekFull[i], s, len) == 0) { + len = static_cast<int>(strlen(kWeekAbbr[i])); + if (strnicmp(kWeekAbbr[i], s, len) == 0) { tm->tm_wday = i; break; } @@ -92,14 +92,14 @@ static char* _strptime(const char *s, const char *format, struct tm *tm) { case 'h': tm->tm_mon = -1; for (int i = 0; i < 12; ++i) { - len = static_cast<int>(strlen(kMonthAbbr[i])); - if (strnicmp(kMonthAbbr[i], s, len) == 0) { + len = static_cast<int>(strlen(kMonthFull[i])); + if (strnicmp(kMonthFull[i], s, len) == 0) { tm->tm_mon = i; break; } - len = static_cast<int>(strlen(kMonthFull[i])); - if (strnicmp(kMonthFull[i], s, len) == 0) { + len = static_cast<int>(strlen(kMonthAbbr[i])); + if (strnicmp(kMonthAbbr[i], s, len) == 0) { tm->tm_mon = i; break; } |