From 726206e5c58c8de0f8a31e45e15a920af1ae06d8 Mon Sep 17 00:00:00 2001 From: Jerome Martinez Date: Mon, 9 Nov 2026 09:26:19 +0100 Subject: [PATCH] ZtringListList: values made only of quotes read with one more quote Write() took the quote opening a quoted field as the first quote of a double quote when the next character is also a quote. A value made only of quotes, written by Read() as a quoted field with doubled quotes, was read back with one more quote: one quote became two, nine quotes became ten. A double quote is now an escaped quote only in a quoted field. --- Source/ZenLib/ZtringListList.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/ZenLib/ZtringListList.cpp b/Source/ZenLib/ZtringListList.cpp index af97e0b..0f72a0a 100644 --- a/Source/ZenLib/ZtringListList.cpp +++ b/Source/ZenLib/ZtringListList.cpp @@ -336,8 +336,8 @@ void ZtringListList::Write(const Ztring &ToWrite) } if (IsQuote) { - //Double quote - if (i+Quote_Size*2<=l) + //Double quote, only in a quoted field: the quote opening a field is never the first one of a double quote + if (q && i+Quote_Size*2<=l) { IsQuote=false; for (size_t j=0; j