[PATCH] Complete fix for KZip

Nicolas Goutte nicog at snafu.de
Sun Nov 17 19:46:38 GMT 2002


Attached is the diff for fixing KZip (file kdelibs/kio/kio/kzip.cpp) compared 
to the revision that has brought the problems. The changes are already in CVS.

Have a nice day/evening/night!

-------------- next part --------------
Index: kzip.cpp
===================================================================
RCS file: /home/kde/kdelibs/kio/kio/kzip.cpp,v
retrieving revision 1.16
retrieving revision 1.19
diff -u -r1.16 -r1.19
--- kzip.cpp	2002/09/13 19:14:09	1.16
+++ kzip.cpp	2002/11/17 19:37:48	1.19
@@ -354,10 +354,10 @@
 
     for ( ; it.current() ; ++it )
     {	//set crc and compressed size in each local file header
-        device()->at( it.current()->headerStart() + 14);
-//	kdDebug(7040) << "closearchive setcrcandcsize: filename: "
-//	    << (*it).filename()
-//	    << " encoding: "<< (*it).encoding() << endl;
+        device()->at( it.current()->headerStart() + 14 );
+	//kdDebug(7040) << "closearchive setcrcandcsize: filename: "
+	//    << it.current()->path()
+	//    << " encoding: "<< it.current()->encoding() << endl;
 
         uLong mycrc = it.current()->crc32();
         buffer[0] = char(mycrc); // crc checksum, at headerStart+14
@@ -400,11 +400,15 @@
             0x14, 0         // version needed to extract
         };
 
-        memcpy(buffer, head, sizeof(head));
+	// I do not know why memcpy is not working here
+        //memcpy(buffer, head, sizeof(head));
+        qmemmove(buffer, head, sizeof(head));
 
         if ( it.current()->encoding() == 8 )
+        {
             buffer[ 8 ] = 8, // general purpose bit flag, deflated
             buffer[ 10 ] = 8; // compression method, deflated
+        }
 
         transformToMsDos( it.current()->datetime(), &buffer[ 12 ] );
 


More information about the kde-core-devel mailing list