Duration: No longer accepts 123e456d as a duration
- Prohibits the use of [eE] in the units. - Permits use of [+-] only in the first position.
This commit is contained in:
@@ -332,7 +332,11 @@ bool Duration::parse (const std::string& input, std::string::size_type& start)
|
||||
}
|
||||
}
|
||||
|
||||
else if (n.getNumber (number))
|
||||
else if (n.getNumber (number) &&
|
||||
number.find ('e') == std::string::npos &&
|
||||
number.find ('E') == std::string::npos &&
|
||||
(number.find ('+') == std::string::npos || number.find ('+') == 0) &&
|
||||
(number.find ('-') == std::string::npos || number.find ('-') == 0))
|
||||
{
|
||||
n.skipWS ();
|
||||
if (n.getOneOf (units, unit))
|
||||
|
||||
Reference in New Issue
Block a user