From 7cd79714facb8e42c7279d5504c9df0b9fe09741 Mon Sep 17 00:00:00 2001 From: Nekotekina Date: Sat, 6 Mar 2021 19:26:41 +0300 Subject: [PATCH] Minor fix for fmt::split with empty string Doesn't affect existing code, I believe. Return at least 1 empty string if is_skip_empty=false. --- Utilities/StrFmt.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Utilities/StrFmt.cpp b/Utilities/StrFmt.cpp index f937da0e2c..ea9c9b3600 100644 --- a/Utilities/StrFmt.cpp +++ b/Utilities/StrFmt.cpp @@ -455,6 +455,11 @@ std::vector fmt::split(std::string_view source, std::initializer_li result.emplace_back(std::string(piece)); } + if (result.empty() && !is_skip_empty) + { + result.emplace_back(); + } + return result; }