Skip to content

Commit

Permalink
Merge pull request #470 from schmave/win-strptime
Browse files Browse the repository at this point in the history
Fix Windows strptime
  • Loading branch information
jwiegley committed Oct 3, 2016
2 parents d4d0334 + 441cade commit bd1a2c5
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/strptime.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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;
}
Expand Down

0 comments on commit bd1a2c5

Please sign in to comment.