View Issue Details

IDProjectCategoryView StatusLast Update
0036691FPCPackagespublic2020-03-04 16:40
ReporterPetr-KAssigned ToMichael Van Canneyt 
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version3.3.1Product Buildr44144 
Target VersionFixed in Version3.3.1 
Summary0036691: Paszlib Zipper - nonzero size of directory in Linux
DescriptionIf FindFirst in Linux returns a directory, then Info.Size is not zero.
IMHO Directory stored in zip should has zero size.

Patch is included.
TagsNo tags attached.
Fixed in Revision44150
FPCOldBugId
FPCTarget3.2.0
Attached Files
  • zipper.patch (682 bytes)
    Index: packages/paszlib/src/zipper.pp
    ===================================================================
    --- packages/paszlib/src/zipper.pp	(revision 44144)
    +++ packages/paszlib/src/zipper.pp	(working copy)
    @@ -1496,7 +1498,10 @@
             Raise EZipError.CreateFmt(SErrMissingFileName,[I]);
           If FindFirst(F.DiskFileName, STDATTR, Info)=0 then
             try
    -          F.Size:=Info.Size;
    +          if Info.Attr and faDirectory <> 0 then //in Linux directory Size <> 0
    +            F.Size := 0
    +          else
    +            F.Size:=Info.Size;
               F.DateTime:=FileDateToDateTime(Info.Time);
             {$IFDEF UNIX}
               if fplstat(F.DiskFileName, @UnixInfo) = 0 then
    
    zipper.patch (682 bytes)

Activities

Petr-K

2020-02-11 10:51

reporter  

zipper.patch (682 bytes)
Index: packages/paszlib/src/zipper.pp
===================================================================
--- packages/paszlib/src/zipper.pp	(revision 44144)
+++ packages/paszlib/src/zipper.pp	(working copy)
@@ -1496,7 +1498,10 @@
         Raise EZipError.CreateFmt(SErrMissingFileName,[I]);
       If FindFirst(F.DiskFileName, STDATTR, Info)=0 then
         try
-          F.Size:=Info.Size;
+          if Info.Attr and faDirectory <> 0 then //in Linux directory Size <> 0
+            F.Size := 0
+          else
+            F.Size:=Info.Size;
           F.DateTime:=FileDateToDateTime(Info.Time);
         {$IFDEF UNIX}
           if fplstat(F.DiskFileName, @UnixInfo) = 0 then
zipper.patch (682 bytes)

Michael Van Canneyt

2020-02-11 11:18

administrator   ~0121012

You are totally right. Checked & applied patch, thank you !

Issue History

Date Modified Username Field Change
2020-02-11 10:51 Petr-K New Issue
2020-02-11 10:51 Petr-K File Added: zipper.patch
2020-02-11 11:18 Michael Van Canneyt Assigned To => Michael Van Canneyt
2020-02-11 11:18 Michael Van Canneyt Status new => resolved
2020-02-11 11:18 Michael Van Canneyt Resolution open => fixed
2020-02-11 11:18 Michael Van Canneyt Fixed in Version => 3.3.1
2020-02-11 11:18 Michael Van Canneyt Fixed in Revision => 44150
2020-02-11 11:18 Michael Van Canneyt FPCTarget => 3.2.0
2020-02-11 11:18 Michael Van Canneyt Note Added: 0121012
2020-03-04 16:40 Petr-K Status resolved => closed