Index: src/ch/FeedbackReplaceDlg.cpp =================================================================== diff -u -rb14efbdfe0eb5c1164b8e5f605b7e9f88fbda25a -rc6022cc2c68d1f286097697f4ba65098b92db222 --- src/ch/FeedbackReplaceDlg.cpp (.../FeedbackReplaceDlg.cpp) (revision b14efbdfe0eb5c1164b8e5f605b7e9f88fbda25a) +++ src/ch/FeedbackReplaceDlg.cpp (.../FeedbackReplaceDlg.cpp) (revision c6022cc2c68d1f286097697f4ba65098b92db222) @@ -156,6 +156,17 @@ dtTemp = m_rDstFile.GetLastWriteTime().GetAsFiletime(); fmt.SetParam(_T("%datemod"), dtTemp.Format(LOCALE_NOUSEROVERRIDE, LANG_USER_DEFAULT)); m_ctlDstDate.SetWindowText(fmt); + + // button captions + CWnd* pAppendButton = GetDlgItem(IDC_COPY_REST_BUTTON); + if(pAppendButton) + { + if(m_rDstFile.GetLength64() > m_rSrcFile.GetLength64()) + { + CString strAltButtonCaption = rManager.LoadString(IDS_BUTTON_TRUNCATE_STRING); + pAppendButton->SetWindowText(strAltButtonCaption); + } + } } void CFeedbackReplaceDlg::RefreshImages() Index: src/ch/ch.rc =================================================================== diff -u -r8a809e7eb52d42ad31789613fe375ba5a1e30a7d -rc6022cc2c68d1f286097697f4ba65098b92db222 --- src/ch/ch.rc (.../ch.rc) (revision 8a809e7eb52d42ad31789613fe375ba5a1e30a7d) +++ src/ch/ch.rc (.../ch.rc) (revision c6022cc2c68d1f286097697f4ba65098b92db222) @@ -416,8 +416,8 @@ EDITTEXT IDC_DST_FILESIZE_EDIT,54,116,251,12,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER EDITTEXT IDC_DST_MODIFIEDDATE_EDIT,54,127,251,12,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER LTEXT "File you are trying to copy already exists. What do you want to do?",IDC_INFO_STATIC,7,7,305,15 - ICON "",IDC_SRC_ICON_STATIC,20,38,21,20 - ICON "",IDC_DST_ICON_STATIC,20,102,21,20 + ICON "",IDC_SRC_ICON_STATIC,20,38,20,20 + ICON "",IDC_DST_ICON_STATIC,20,102,20,20 GROUPBOX "Source file",IDC_SRCFILE_STATIC,7,20,305,58 GROUPBOX "Destination file",IDC_DSTFILE_STATIC,7,83,305,58 END @@ -1167,13 +1167,18 @@ IDS_BDTREE_STRING "Tree" IDS_BDNDSCONTAINER_STRING "NDS Container" IDS_INFO_PATH_STRING "Location: %pathname" - IDS_INFO_FILE_STRING "File: %filename" IDS_INFO_SIZE_STRING "Size: %size" IDS_INFO_MODIFIED_STRING "Modified: %datemod" END STRINGTABLE BEGIN + IDS_INFO_REASON_STRING "Reason: %reason" + IDS_INFO_FILE_STRING "File: %filename" +END + +STRINGTABLE +BEGIN IDS_INFO_TWO_FILE_STRING "Source file: %filename\nDestination file: %dstfilename" IDS_OK_STRING "&OK" @@ -1213,13 +1218,9 @@ IDS_ALWAYS_SHOW_STRING "Always show" IDS_HIDE_AND_REGISTER "Hide and register extension" IDS_HIDE_AND_DONT_REGISTER "Hide and do not register extension" + IDS_BUTTON_TRUNCATE_STRING "&Truncate" END -STRINGTABLE -BEGIN - IDS_INFO_REASON_STRING "Reason: %reason" -END - #endif // English (United States) resources ///////////////////////////////////////////////////////////////////////////// Index: src/ch/resource.h =================================================================== diff -u -r8a809e7eb52d42ad31789613fe375ba5a1e30a7d -rc6022cc2c68d1f286097697f4ba65098b92db222 --- src/ch/resource.h (.../resource.h) (revision 8a809e7eb52d42ad31789613fe375ba5a1e30a7d) +++ src/ch/resource.h (.../resource.h) (revision c6022cc2c68d1f286097697f4ba65098b92db222) @@ -678,6 +678,7 @@ #define IDS_EMPTYSUBTASKNAME_STRING 21554 #define IDS_STATUS_LOADERROR_STRING 21555 #define IDS_EXPORTING_TASK_FAILED 21556 +#define IDS_BUTTON_TRUNCATE_STRING 21557 #define ID_POPUP_SHOW_STATUS 32773 #define ID_POPUP_TIME_CRITICAL 32774 #define ID_POPUP_HIGHEST 32775 Index: src/libchcore/TSubTaskCopyMove.cpp =================================================================== diff -u -re8f31b0f922b402878356e130c866c4f3682a7f5 -rc6022cc2c68d1f286097697f4ba65098b92db222 --- src/libchcore/TSubTaskCopyMove.cpp (.../TSubTaskCopyMove.cpp) (revision e8f31b0f922b402878356e130c866c4f3682a7f5) +++ src/libchcore/TSubTaskCopyMove.cpp (.../TSubTaskCopyMove.cpp) (revision c6022cc2c68d1f286097697f4ba65098b92db222) @@ -665,6 +665,13 @@ return TSubTaskBase::eSubResult_Continue; } + // ullSeekTo contains the seek position in destination file; in case the destination is already + // larger than source file all we can do is to perform truncation of destination file to the size of + // source file. + // NOTE: the truncation that will be the result of the following assignment might cause the end of destination file + // to be overwritten by the end of source file. + ullSeekTo = std::min(ullSeekTo, fsNewSize); + // seek to the position where copying will start file_size_t fsMoveTo = spFileDst->GetSeekPositionForResume(ullSeekTo);