~ubuntu-branches/debian/squeeze/kdelibs/squeeze

« back to all changes in this revision

Viewing changes to debian/patches/67_kio_zip_file_encoding.diff

  • Committer: Bazaar Package Importer
  • Author(s): Modestas Vainius
  • Date: 2010-08-07 23:20:21 UTC
  • Revision ID: james.westby@ubuntu.com-20100807232021-owvkgp5wpc076s33
Tags: 4:3.5.10.dfsg.1-5
* Change by email address to @debian.org.
* Drop common HTML docs from kdelibs-data package. Instead suggest
  kdelibs5-data which ships them (Closes: #591609). What's more, whoever
  wants to view docs, will have to install khelpcenter4 which pulls in
  kdelibs5-data anyway.
* Switch to dpkg-source format 3.0 (quilt):
  - drop simple-patchsys.mk from debian/rules;
  - add debian/patches/series file.
* Fix corruption of zip files caused by wrong encoding of umlauts in kzip
  (patch 67_kio_zip_file_encoding.diff). (Closes: #563942) Thanks to Bjoern
  Ricks for the patch.
* Support opening of KDE 4 khelpcenter in Help -> Handbook. (Closes: #525621)
  Thanks to Ben Burton for the patch.
* Do not recurse into .pc subdirectory with doxygen 
  (patch debian/patches/02_exclude_pc_from_dox.diff).
* Urgency=medium due to multiple RC bug fixes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
From: Bjoern Ricks <bjoern.ricks@intevation.de>
 
2
Description: fix corruption in zip files caused by wrong encoding of umlauts
 
3
Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=563942
 
4
Forwarded: no
 
5
Last-Update: 2010-08-07
 
6
 
 
7
--- a/kio/kio/kzip.cpp
 
8
+++ b/kio/kio/kzip.cpp
 
9
@@ -954,8 +954,8 @@ bool KZip::closeArchive()
 
10
         buffer[ 26 ] = char(mysize >> 16);
 
11
         buffer[ 27 ] = char(mysize >> 24);
 
12
 
 
13
-        buffer[ 28 ] = char(it.current()->path().length()); // filename length
 
14
-        buffer[ 29 ] = char(it.current()->path().length() >> 8);
 
15
+        buffer[ 28 ] = char(path.length()); // filename length
 
16
+        buffer[ 29 ] = char(path.length() >> 8);
 
17
 
 
18
        buffer[ 30 ] = char(extra_field_len);
 
19
        buffer[ 31 ] = char(extra_field_len >> 8);
 
20
@@ -1280,9 +1280,10 @@ bool KZip::doneWriting( uint size )
 
21
     if ( d->m_extraField == ModificationTime )
 
22
         extra_field_len = 17;  // value also used in doneWriting()
 
23
 
 
24
+    const QCString encodedName = QFile::encodeName(d->m_currentFile->path());
 
25
     int csize = device()->at() -
 
26
         d->m_currentFile->headerStart() - 30 -
 
27
-               d->m_currentFile->path().length() - extra_field_len;
 
28
+        encodedName.length() - extra_field_len;
 
29
     d->m_currentFile->setCompressedSize(csize);
 
30
     //kdDebug(7040) << "usize: " << d->m_currentFile->size() << endl;
 
31
     //kdDebug(7040) << "csize: " << d->m_currentFile->compressedSize() << endl;