From 95df319b2578245ba4737acb721a9a4d56449d7d Mon Sep 17 00:00:00 2001 From: youdie006 Date: Tue, 1 Sep 2026 11:54:35 +0900 Subject: [PATCH] Wrap a value that is itself quoted when SetQuotes is on The loader strips an outer quote pair from any value that begins and ends with a quote, but the writer only wraps values with leading or trailing whitespace, so such a value lost its quotes on every save/load cycle. The loader already reads the doubled form correctly. --- SimpleIni.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/SimpleIni.h b/SimpleIni.h index ba272a6..cd657c9 100644 --- a/SimpleIni.h +++ b/SimpleIni.h @@ -1858,6 +1858,11 @@ bool CSimpleIniTempl:: return true; } + // a value that is itself quoted needs wrapping, or the loader strips its quotes + if (a_pData > pStart + 1 && *pStart == '"' && *(a_pData - 1) == '"') { + return true; + } + return false; }