diff --git a/winixd/functions/mv.cpp b/winixd/functions/mv.cpp index 960129b..1ab030b 100644 --- a/winixd/functions/mv.cpp +++ b/winixd/functions/mv.cpp @@ -584,12 +584,16 @@ bool Mv::MoveFileOrSymlink2(Item & src_file, const std::wstring & dst_path, bool if( !ParseDir(dst_path, check_access) ) return false; - if( src_file.parent_id == out_dir_tab.back()->id ) + if( out_has_file && src_file.parent_id == out_dir_tab.back()->id && src_file.url == out_item.url ) { - // actually out_filename is here empty - // because ParseDir() have been read it to out_item - if( out_filename.empty() || src_file.url == out_filename ) - return true; // the same file -- there is nothing to do + return true; // the same file -- there is nothing to do + } + + if( out_has_file ) + { + log << log3 << "Mv: such file already exists (skipping)" << logend; + slog << logerror << T("mv_file_exists") << logend; + return false; } return MoveFileOrSymlink(src_file, out_dir_tab, out_filename);