Don't fail on nearly blank lines

If a line only contains tabs the word will be an empty string. And then
is_prefix_of does match on rule, beacuse it's substring of length 0 is
also an empty string. Subsequently the parsing of the rule fails with an
exception.
This commit is contained in:
Björn Schäpers
2025-06-05 10:09:51 +02:00
committed by Howard Hinnant
parent f94b8f36c6
commit 6d7739e7e8

View File

@ -3838,6 +3838,10 @@ init_tzdb()
std::istringstream in(line);
std::string word;
in >> word;
if (word.empty())
{
continue;
}
tolower(word);
if (is_prefix_of(word, "rule"))
{