From 8ff38e6b4f34828b3549ef4ef492076c39d6ba66 Mon Sep 17 00:00:00 2001 From: kelly Date: Tue, 3 Jan 2023 15:20:53 -0800 Subject: [PATCH] Ensure last chunk of XML data is parsed Fixes case where last chunk was skipped during parse --- Sources/FoundationXML/XMLParser.swift | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Sources/FoundationXML/XMLParser.swift b/Sources/FoundationXML/XMLParser.swift index 2d160f3945..03e3a5da07 100644 --- a/Sources/FoundationXML/XMLParser.swift +++ b/Sources/FoundationXML/XMLParser.swift @@ -603,10 +603,7 @@ open class XMLParser : NSObject { var result = true var chunkStart = 0 var chunkEnd = min(_chunkSize, data.count) - while result { - if chunkStart >= data.count || chunkEnd >= data.count { - break - } + while result && chunkStart != chunkEnd { let chunk = data[chunkStart..