Commit 6e16eee0 authored by Joachim Eibl's avatar Joachim Eibl

Fixed problem where destination directory would be renamed or deleted

during copy operation. Now if the destination directory exists only the
files inside will be copied.


git-svn-id: https://kdiff3.svn.sourceforge.net/svnroot/kdiff3/trunk@100 c8aa9fed-2811-0410-8543-893ada326672
parent 11dbd4d9
......@@ -2500,7 +2500,9 @@ bool DirectoryMergeWindow::copyFLD( const QString& srcName, const QString& destN
if ( srcName == destName )
return true;
if ( FileAccess(destName, true).exists() )
FileAccess fi( srcName );
FileAccess faDest(destName, true);
if ( faDest.exists() && !( fi.isDir() && faDest.isDir() && (fi.isSymLink()==faDest.isSymLink())) )
{
bool bSuccess = deleteFLD( destName, m_pOptions->m_bDmCreateBakFiles );
if ( !bSuccess )
......@@ -2511,7 +2513,6 @@ bool DirectoryMergeWindow::copyFLD( const QString& srcName, const QString& destN
}
}
FileAccess fi( srcName );
if ( fi.isSymLink() && ((fi.isDir() && !m_bFollowDirLinks) || (!fi.isDir() && !m_bFollowFileLinks)) )
{
......@@ -2539,8 +2540,13 @@ bool DirectoryMergeWindow::copyFLD( const QString& srcName, const QString& destN
if ( fi.isDir() )
{
bool bSuccess = makeDir( destName );
return bSuccess;
if ( faDest.exists() )
return true;
else
{
bool bSuccess = makeDir( destName );
return bSuccess;
}
}
int pos=destName.lastIndexOf('/');
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment