+            // no more delimiters, the token is everything till the end of
+            // string
+            token.assign(m_pos, m_stringEnd);
+
+            // skip the token
+            m_pos = m_stringEnd;
+
+            // it wasn't terminated
+            m_lastDelim = _T('\0');
+        }
+        else // we found a delimiter at pos
+        {
+            // in wxTOKEN_RET_DELIMS mode we return the delimiter character
+            // with token, otherwise leave it out
+            wxString::const_iterator tokenEnd(pos);
+            if ( m_mode == wxTOKEN_RET_DELIMS )
+                ++tokenEnd;
+
+            token.assign(m_pos, tokenEnd);
+
+            // skip the token and the trailing delimiter
+            m_pos = pos + 1;
+
+            m_lastDelim = (pos == m_stringEnd) ? _T('\0') : (wxChar)*pos;