From c4ebeb7b42e4d0143798265aa930ad738f832f71 Mon Sep 17 00:00:00 2001 From: Ryan Oldenburg Date: Thu, 18 Apr 2024 12:16:46 -0500 Subject: [PATCH] f --- src/zippy/ziparchives.nim | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/zippy/ziparchives.nim b/src/zippy/ziparchives.nim index 00afbff..60ec564 100644 --- a/src/zippy/ziparchives.nim +++ b/src/zippy/ziparchives.nim @@ -502,8 +502,11 @@ when (NimMajor, NimMinor, NimPatch) >= (1, 6, 0): compressionMethod: uint16 uncompressedCrc32: uint32 - var records: seq[(string, ArchiveEntry)] - for fileName in toSeq(entries.keys): # The entries table is modified so use toSeq + var + keys = toSeq(entries.keys) # The entries table is modified so use toSeq + records: seq[(string, ArchiveEntry)] + while keys.len > 0: + let fileName = keys.pop() if fileName == "": raise newException(ZippyError, "Invalid empty file name") if fileName[0] == '/':