Patch for KZip in kio
Stefan Gehn
sgehn at gmx.net
Fri Jan 10 16:26:41 GMT 2003
Moin,
because the maintainer did not answer to my mail including a nice patch (sent
on dec 27th 2002) I'll post it here now :)
Here's the original mail I sent:
-------------------------------------------------------------------
I frequently got annoyed by zipfiles with their directories shown twice and no
files in them. I debugged it some more and it seems to come from this
difference (unzip -l listing of two files):
CORRECT:
Length Date Time Name
------- ---- ---- ----
0 12-27-02 12:28 ordner/unterordner2/
4656012 12-22-02 18:39 ordner/unterordner2/p3b-f-104.pdf
44605 12-06-02 10:33 ordner/unterordner2/tcpdump_no_answer.txt
WRONG:
Length Date Time Name
------- ---- ---- ----
237 11-22-02 10:46 System/Manga.upl
0 11-22-02 10:50 System/
428606 11-22-02 10:46 Animations/MangaB.ukx
0 11-22-02 10:51 Animations/
As you can see the files come before the directory-entry in the listing. This
seems to be a weirdness by some zip-archiver on windows, probably maybe even
the very well known WinZip. Midnight Commander had the same problem in
earlier versions btw :)
Attached is a patch doing the following:
if entry is a dir first check if we already have it appended, if yes set entry
to 0L which later results in not appending any entry at all.
For broken ZIPs the dir-entries then get added by the findOrCreate()-call some
lines below.
I tested this with a selfmade ZIP and different downloaded ZIPs (windows and
unix downloads) and it worked fine for me.
Bye, Stefan aka mETz
--
sgehn_AT_gmx.net | ICQ#51123152 | Moege der Pinguin mit euch sein
-------------- next part --------------
A non-text attachment was scrubbed...
Name: kzip.patch
Type: text/x-diff
Size: 3038 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20030110/72712cda/attachment.patch>
More information about the kde-core-devel
mailing list