tg = m_CacheSize++;
m_Cache[tg].Key = stpos = pos++;
dummy[0] = 0; i = 0;
- while ((src[pos] != wxT('>')) && (src[pos] != wxT(' '))) {
+ while (pos < lng &&
+ src[pos] != wxT('>') &&
+ src[pos] != wxT(' ') && src[pos] != wxT('\r') &&
+ src[pos] != wxT('\n') && src[pos] != wxT('\t')) {
dummy[i] = src[pos++];
if ((dummy[i] >= wxT('a')) && (dummy[i] <= wxT('z'))) dummy[i] -= (wxT('a') - wxT('A'));
i++;
m_Cache[tg].Name = new wxChar[i+1];
memcpy(m_Cache[tg].Name, dummy, (i+1)*sizeof(wxChar));
- while (src[pos] != wxT('>')) pos++;
+ while (pos < lng && src[pos] != wxT('>')) pos++;
if (src[stpos+1] == wxT('/')) { // ending tag:
m_Cache[tg].End1 = m_Cache[tg].End2 = -2;
if (source[i] == '/') {m_Ending = TRUE; i++;}
else m_Ending = FALSE;
- while ((i < end_pos) && ((c = source[i++]) != ' ') && (c != '>')) {
+ while ((i < end_pos) &&
+ ((c = source[i++]) != ' ' && c != '\r' && c != '\n' && c != '\t' &&
+ c != '>')) {
if ((c >= 'a') && (c <= 'z')) c -= ('a' - 'A');
m_Name += c;
}
if (source[i-1] != '>')
while ((i < end_pos) && ((c = source[i++]) != '>')) {
if ((c >= 'a') && (c <= 'z')) c -= ('a' - 'A');
+ if (c == '\r' || c == '\n' || c == '\t') c = ' '; // make future parsing a bit simpler
m_Params += c;
if (c == '"') {
while ((i < end_pos) && ((c = source[i++]) != '"')) m_Params += c;