another buglet in ParseDate() fixed

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_2_BRANCH@7457 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2000-05-22 13:10:15 +00:00
parent da14645955
commit 0acd3d9a08

View File

@@ -3021,7 +3021,6 @@ const wxChar *wxDateTime::ParseDate(const wxChar *date)
wxStringTokenizer tok(p, dateDelimiters); wxStringTokenizer tok(p, dateDelimiters);
while ( tok.HasMoreTokens() ) while ( tok.HasMoreTokens() )
{ {
nPosCur = tok.GetPosition();
wxString token = tok.GetNextToken(); wxString token = tok.GetNextToken();
// is it a number? // is it a number?
@@ -3140,8 +3139,9 @@ const wxChar *wxDateTime::ParseDate(const wxChar *date)
} }
else // not a number else // not a number
{ {
mon = GetMonthFromName(token, Name_Full | Name_Abbr); // be careful not to overwrite the current mon value
if ( mon != Inv_Month ) Month mon2 = GetMonthFromName(token, Name_Full | Name_Abbr);
if ( mon2 != Inv_Month )
{ {
// it's a month // it's a month
if ( haveMon ) if ( haveMon )
@@ -3149,6 +3149,8 @@ const wxChar *wxDateTime::ParseDate(const wxChar *date)
break; break;
} }
mon = mon2;
haveMon = TRUE; haveMon = TRUE;
} }
else else
@@ -3223,6 +3225,8 @@ const wxChar *wxDateTime::ParseDate(const wxChar *date)
} }
} }
} }
nPosCur = tok.GetPosition();
} }
// either no more tokens or the scan was stopped by something we couldn't // either no more tokens or the scan was stopped by something we couldn't