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);
while ( tok.HasMoreTokens() )
{
nPosCur = tok.GetPosition();
wxString token = tok.GetNextToken();
// is it a number?
@@ -3140,8 +3139,9 @@ const wxChar *wxDateTime::ParseDate(const wxChar *date)
}
else // not a number
{
mon = GetMonthFromName(token, Name_Full | Name_Abbr);
if ( mon != Inv_Month )
// be careful not to overwrite the current mon value
Month mon2 = GetMonthFromName(token, Name_Full | Name_Abbr);
if ( mon2 != Inv_Month )
{
// it's a month
if ( haveMon )
@@ -3149,6 +3149,8 @@ const wxChar *wxDateTime::ParseDate(const wxChar *date)
break;
}
mon = mon2;
haveMon = TRUE;
}
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