diff --git a/README.md b/README.md index e733a27..6278579 100644 --- a/README.md +++ b/README.md @@ -277,6 +277,7 @@ UTF-8 decoding is performed using a state machine based on Bjoern Hoehrmann's '[ - **[@traversaro](https://github.com/traversaro)** - Added vcpkg support and reported a bunch of bugs - **[@whiterabbit963](https://github.com/whiterabbit963)** - Fixed a bug with value_or conversions - **[@ximion](https://github.com/ximion)** - Added support for installation with meson +- **[@a-is](https://github.com/a-is)** - Fixed a bug
diff --git a/include/toml++/impl/at_path.inl b/include/toml++/impl/at_path.inl index 9311579..189d115 100644 --- a/include/toml++/impl/at_path.inl +++ b/include/toml++/impl/at_path.inl @@ -97,7 +97,7 @@ TOML_IMPL_NAMESPACE_START } else if TOML_UNLIKELY(c == '.' || c == '[') break; - else if (c == '\t' || c == '.') + else if (c == '\t' || c == ' ') pos++; else return false; diff --git a/tests/path.cpp b/tests/path.cpp index 84b2591..e6d2127 100644 --- a/tests/path.cpp +++ b/tests/path.cpp @@ -16,7 +16,8 @@ TEST_CASE("path - parsing") CHECK(toml::path(" [1][2]").str() == " [1][2]"); CHECK(toml::path("a. .b").str() == "a. .b"); CHECK(toml::path("test[23]").str() == "test[23]"); - CHECK(toml::path("[ 120 ]").str() == "[120]"); + CHECK(toml::path("[ 120 ]").str() == "[120]"); + CHECK(toml::path("[ 120\t\t]").str() == "[120]"); CHECK(toml::path("test.value").str() == "test.value"); CHECK(toml::path("test[0].value").str() == "test[0].value"); CHECK(toml::path("test[1][2]\t .value").str() == "test[1][2].value"); @@ -31,7 +32,8 @@ TEST_CASE("path - parsing") CHECK(toml::path(L" [1][2]").str() == " [1][2]"); CHECK(toml::path(L"a. .b").str() == "a. .b"); CHECK(toml::path(L"test[23]").str() == "test[23]"); - CHECK(toml::path(L"[ 120 ]").str() == "[120]"); + CHECK(toml::path(L"[ 120 ]").str() == "[120]"); + CHECK(toml::path(L"[ 120\t\t]").str() == "[120]"); CHECK(toml::path(L"test.value").str() == "test.value"); CHECK(toml::path(L"test[0].value").str() == "test[0].value"); CHECK(toml::path(L"test[1][2]\t .value").str() == "test[1][2].value"); diff --git a/toml.hpp b/toml.hpp index 2c006ea..7174941 100644 --- a/toml.hpp +++ b/toml.hpp @@ -10490,7 +10490,7 @@ TOML_IMPL_NAMESPACE_START } else if TOML_UNLIKELY(c == '.' || c == '[') break; - else if (c == '\t' || c == '.') + else if (c == '\t' || c == ' ') pos++; else return false;