diff --git a/toml/source_location.hpp b/toml/source_location.hpp index 051f4e5..f85c51e 100644 --- a/toml/source_location.hpp +++ b/toml/source_location.hpp @@ -48,7 +48,11 @@ struct source_location { if(reg) { - line_num_ = static_cast(std::stoul(reg->line_num())); + if(reg->line_num() != detail::region_base().line_num()) + { + line_num_ = static_cast( + std::stoul(reg->line_num())); + } column_num_ = static_cast(reg->before() + 1); region_size_ = static_cast(reg->size()); file_name_ = reg->name();