- register off_t pos, pos2;
- wxString r_string;
-
- if (m_string.IsNull())
- return m_string;
-
- if (!m_retdelims)
- EatLeadingDelims(); // AVS - added to fix leading whitespace /
- // mult. delims bugs
+ off_t pos, pos2;
+ wxString r_string;
+
+ if ( m_string.IsEmpty() )
+ return m_string;
+
+ if ( !m_retdelims )
+ EatLeadingDelims();
+
+ pos = FindDelims(m_string, m_delims);
+ if (pos == -1)
+ {
+ r_string = m_string;
+ m_string = wxEmptyString;
+
+ return r_string;
+ }
+
+ if (m_retdelims)
+ {
+ if (!pos)
+ {
+ pos++;
+ pos2 = 1;
+ }
+ else
+ {
+ pos2 = pos;
+ }
+ }
+ else
+ {
+ pos2 = pos + 1;
+ }
+
+ r_string = m_string.Left((size_t)pos);
+ m_string = m_string.Mid((size_t)pos2);