mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-06-26 10:54:26 +02:00
Lexer: ::isAllDigits should not return true on trivial input
This commit is contained in:
parent
1590ab6564
commit
808600a705
1 changed files with 2 additions and 1 deletions
|
@ -1302,7 +1302,8 @@ std::string Lexer::typeToString (Lexer::Type type)
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
bool Lexer::isAllDigits (const std::string& text)
|
||||
{
|
||||
return text.find_first_not_of ("0123456789") == std::string::npos;
|
||||
return text.length () &&
|
||||
text.find_first_not_of ("0123456789") == std::string::npos;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue