Do not consume whitespace/delimiters after date in DateParse()
Set the end iterator to the end of the actually parsed date, instead of consuming any ultimately unparsed whitespace/delimiters possibly following the date.
This commit is contained in:
committed by
Vadim Zeitlin
parent
945738042d
commit
088e643d37
@@ -1866,17 +1866,19 @@ wxDateTime::ParseDate(const wxString& date, wxString::const_iterator *end)
|
||||
// tokenize the string
|
||||
while ( p != pEnd )
|
||||
{
|
||||
// skip white space and date delimiters
|
||||
if ( wxStrchr(".,/-\t\r\n ", *p) )
|
||||
{
|
||||
++p;
|
||||
continue;
|
||||
}
|
||||
|
||||
// modify copy of the iterator as we're not sure if the next token is
|
||||
// still part of the date at all
|
||||
wxString::const_iterator pCopy = p;
|
||||
|
||||
// skip white space and date delimiters
|
||||
while ( pCopy != pEnd && wxStrchr(".,/-\t\r\n ", *pCopy) )
|
||||
{
|
||||
++pCopy;
|
||||
}
|
||||
|
||||
if ( pCopy == pEnd )
|
||||
break;
|
||||
|
||||
// we can have either alphabetic or numeric token, start by testing if
|
||||
// it's the latter
|
||||
unsigned long val;
|
||||
|
||||
Reference in New Issue
Block a user