From 995b25efe082476f452d1f6bfae3e39de30034b5 Mon Sep 17 00:00:00 2001 From: ToruNiina Date: Thu, 20 Jun 2024 21:10:42 +0900 Subject: [PATCH] fix: pass empty filename to format_location not to skip the first empty line --- include/toml11/fwd/source_location_fwd.hpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/include/toml11/fwd/source_location_fwd.hpp b/include/toml11/fwd/source_location_fwd.hpp index 73e107e..77c7579 100644 --- a/include/toml11/fwd/source_location_fwd.hpp +++ b/include/toml11/fwd/source_location_fwd.hpp @@ -107,10 +107,8 @@ std::string format_location( { const auto lnw = detail::line_width(loc, msg, tail...); - std::ostringstream oss; - detail::format_filename(oss, loc); - - return oss.str() + detail::format_location_rec(lnw, loc.file_name(), loc, msg, tail...); + const std::string f(""); // at the 1st iteration, no prev_filename is given + return detail::format_location_rec(lnw, f, loc, msg, tail...); } } // toml