File 3_5_BRANCH-r584351.diff of Package kdelibs3
------------------------------------------------------------------------
r584351 | dfaure | 2006-09-14 15:46:06 +0200 (Thu, 14 Sep 2006) | 4 lines
Fix handling of hardlinks again:
fix for #20344 was wrong - testcase: http://www.ibiblio.org/pub/Linux/utils/disk-management/cdrecord-1.9.tar.gz
this testcase broke too: "echo hello > A; ln A B; echo C>C; tar cf hardlink.tar A B C"
------------------------------------------------------------------------
Index: kio/kio/ktar.cpp
===================================================================
--- kio/kio/ktar.cpp (revision 584350)
+++ kio/kio/ktar.cpp (revision 584351)
@@ -439,8 +439,8 @@ bool KTar::openArchive( int mode )
// Let's hack around hard links. Our classes don't support that, so make them symlinks
if ( typeflag == '1' )
{
- size = nm.length(); // in any case, we don't want to skip the real size, hence this resetting of size
- kdDebug(7041) << "HARD LINK, setting size to " << size << endl;
+ kdDebug(7041) << "HARD LINK, setting size to 0 instead of " << size << endl;
+ size = 0; // no contents
}
//kdDebug(7041) << "KTar::openArchive file " << nm << " size=" << size << endl;
Index: kio/tests/ktartest.cpp
===================================================================
--- kio/tests/ktartest.cpp (revision 584350)
+++ kio/tests/ktartest.cpp (revision 584351)
@@ -30,7 +30,9 @@ void recursive_print( const KTarDirector
for( ; it != l.end(); ++it )
{
const KTarEntry* entry = dir->entry( (*it) );
- printf("mode=%07o %s %s %s%s isdir=%d\n", entry->permissions(), entry->user().latin1(), entry->group().latin1(), path.latin1(), (*it).latin1(), entry->isDirectory());
+ printf("mode=%07o %s %s %s%s %d isdir=%d\n", entry->permissions(), entry->user().latin1(), entry->group().latin1(), path.latin1(), (*it).latin1(),
+ entry->isFile() ? static_cast<const KArchiveFile *>(entry)->size() : 0,
+ entry->isDirectory());
if (entry->isDirectory())
recursive_print( (KTarDirectory *)entry, path+(*it)+"/" );
}