[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [kdelibs/KDE/4.10] kdecore/io: Do not overwrite directories with the same name inside an archive.
From:       Dawit Alemayehu <adawit () kde ! org>
Date:       2013-05-12 1:44:47
Message-ID: 20130512014447.E33FFA605B () git ! kde ! org
[Download RAW message or body]

Git commit fa9fa9ce0271e44117a70f03af58aa1963ba5df5 by Dawit Alemayehu.
Committed on 11/05/2013 at 21:38.
Pushed by adawit into branch 'KDE/4.10'.

Do not overwrite directories with the same name inside an archive.

BUG: 206994
REVIEW: 110392
FIXED-IN: 4.10.4

M  +4    -1    kdecore/io/ktar.cpp

http://commits.kde.org/kdelibs/fa9fa9ce0271e44117a70f03af58aa1963ba5df5

diff --git a/kdecore/io/ktar.cpp b/kdecore/io/ktar.cpp
index 142a80a..7cbf620 100644
--- a/kdecore/io/ktar.cpp
+++ b/kdecore/io/ktar.cpp
@@ -471,7 +471,10 @@ bool KTar::openArchive( QIODevice::OpenMode mode ) {
                         setRootDir( static_cast<KArchiveDirectory *>( e ) );
                     }
                 } else {
-                    rootDir()->addEntry( e );
+                    const KArchiveEntry* entry = rootDir()->entry(e->name());
+                    if (!entry || !entry->isDirectory()) {
+                        rootDir()->addEntry( e );
+                    }
                 }
             }
             else
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic