From be5ffaf6621eeb2feea7d4d4f84ec5917f5a8557 Mon Sep 17 00:00:00 2001 From: ToruNiina Date: Sun, 27 Jun 2021 18:56:57 +0900 Subject: [PATCH] feat: check if width == max before using ml-string --- toml/serializer.hpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/toml/serializer.hpp b/toml/serializer.hpp index 4881c3d..2a0855f 100644 --- a/toml/serializer.hpp +++ b/toml/serializer.hpp @@ -178,8 +178,9 @@ struct serializer { if(s.kind == string_t::basic) { - if(std::find(s.str.cbegin(), s.str.cend(), '\n') != s.str.cend() || - std::find(s.str.cbegin(), s.str.cend(), '\"') != s.str.cend()) + if((std::find(s.str.cbegin(), s.str.cend(), '\n') != s.str.cend() || + std::find(s.str.cbegin(), s.str.cend(), '\"') != s.str.cend()) && + this->width_ != std::numeric_limits::max()) { // if linefeed or double-quote is contained, // make it multiline basic string.