- Added disqualifier for id sequences in the form of a set of acceptable
  characters.  Prevents strange problems due to the 'split' calls that are used
  in the implementation.
This commit is contained in:
Paul Beckingham 2014-09-06 23:40:57 -04:00
parent 7c8432d162
commit cb080e70de

View file

@ -1292,14 +1292,17 @@ void Parser::findIdSequence ()
if (! (*i)->hasTag ("?")) if (! (*i)->hasTag ("?"))
continue; continue;
// Easy disqualifiers.
if (raw.find_first_not_of ("0123456789,-") != std::string::npos)
break;
// Container for min/max ID ranges. // Container for min/max ID ranges.
std::vector <std::pair <int, int> > ranges; std::vector <std::pair <int, int> > ranges;
// Split the ID list into elements. // Split the ID list into elements.
std::vector <std::string> elements; std::vector <std::string> elements;
split (elements, raw, ','); split (elements, raw, ',');
if (elements.size ())
{
bool not_an_id = false; bool not_an_id = false;
std::vector <std::string>::iterator e; std::vector <std::string>::iterator e;
for (e = elements.begin (); e != elements.end (); ++e) for (e = elements.begin (); e != elements.end (); ++e)
@ -1358,6 +1361,11 @@ void Parser::findIdSequence ()
break; break;
} }
} }
else
{
not_an_id = true;
break;
}
} }
if (not_an_id) if (not_an_id)
@ -1437,7 +1445,6 @@ void Parser::findIdSequence ()
break; break;
} }
} }
}
while (action); while (action);
} }