summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2016-10-03 09:18:33 -0700
committerGitHub <noreply@github.com>2016-10-03 09:18:33 -0700
commitbd1a2c528addde67a3d42dfa9c6cedcfd30db8cc (patch)
treef2604223018806eeec177992e9eb8a6b328f0ca0 /src
parentd4d0334a3b1b4ba24d540c21eb157a5e1b36d189 (diff)
parent441cadead34be79a4d1a6bab5a7683b7f7227f3f (diff)
downloadfork-ledger-bd1a2c528addde67a3d42dfa9c6cedcfd30db8cc.tar.gz
fork-ledger-bd1a2c528addde67a3d42dfa9c6cedcfd30db8cc.tar.bz2
fork-ledger-bd1a2c528addde67a3d42dfa9c6cedcfd30db8cc.zip
Merge pull request #470 from schmave/win-strptime
Fix Windows strptime
Diffstat (limited to 'src')
-rw-r--r--src/strptime.cc16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/strptime.cc b/src/strptime.cc
index c0aed41c..6f670baf 100644
--- a/src/strptime.cc
+++ b/src/strptime.cc
@@ -83,14 +83,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;
}
@@ -105,14 +105,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;
}