From 6d7739e7e8e8864dc5eb79e42b6c2675cd7733ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Sch=C3=A4pers?= Date: Thu, 5 Jun 2025 10:09:51 +0200 Subject: [PATCH] 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. --- src/tz.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/tz.cpp b/src/tz.cpp index 15c9f5d..c3c7a52 100644 --- a/src/tz.cpp +++ b/src/tz.cpp @@ -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")) {