mirror of
https://github.com/HowardHinnant/date.git
synced 2025-07-31 19:24:28 +02:00
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:
committed by
Howard Hinnant
parent
f94b8f36c6
commit
6d7739e7e8
@@ -3838,6 +3838,10 @@ init_tzdb()
|
|||||||
std::istringstream in(line);
|
std::istringstream in(line);
|
||||||
std::string word;
|
std::string word;
|
||||||
in >> word;
|
in >> word;
|
||||||
|
if (word.empty())
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
tolower(word);
|
tolower(word);
|
||||||
if (is_prefix_of(word, "rule"))
|
if (is_prefix_of(word, "rule"))
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user