From 566d04f0c63d0257e7dd235eba1e047e0d746b68 Mon Sep 17 00:00:00 2001 From: Ketmar Dark Date: Fri, 8 Apr 2016 21:13:29 +0300 Subject: [PATCH] search files in archives starting from last generally, archive can contain files with the same name, and we probably want the last one, as it is usually newer than others. --- src/shared/WADEDITOR.pas | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/shared/WADEDITOR.pas b/src/shared/WADEDITOR.pas index c9af0bd..de67069 100644 --- a/src/shared/WADEDITOR.pas +++ b/src/shared/WADEDITOR.pas @@ -163,7 +163,8 @@ begin if not isOpen or (fIter = nil) then Exit; if length(Resource) = 0 then Exit; // just in case if (length(Section) <> 0) and (Section[length(Section)] <> '/') then Section := Section+'/'; - for f := 0 to fIter.Count-1 do + // backwards, due to possible similar names and such + for f := fIter.Count-1 downto 0 do begin fi := fIter.Files[f]; if fi = nil then continue; -- 2.29.2