mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-07-07 20:06:36 +02:00
Parser
- 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:
parent
7c8432d162
commit
cb080e70de
1 changed files with 132 additions and 125 deletions
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue