diff options
Diffstat (limited to 'CPP/7zip/UI/Far')
-rw-r--r-- | CPP/7zip/UI/Far/FarUtils.cpp | 2 | ||||
-rw-r--r-- | CPP/7zip/UI/Far/FarUtils.h | 2 | ||||
-rw-r--r-- | CPP/7zip/UI/Far/OverwriteDialogFar.cpp | 13 |
3 files changed, 14 insertions, 3 deletions
diff --git a/CPP/7zip/UI/Far/FarUtils.cpp b/CPP/7zip/UI/Far/FarUtils.cpp index 1875a189..cc058ef9 100644 --- a/CPP/7zip/UI/Far/FarUtils.cpp +++ b/CPP/7zip/UI/Far/FarUtils.cpp @@ -448,7 +448,7 @@ int PrintErrorMessage(const char *message, const char *text) } -static void ReduceString(UString &s, unsigned size) +void ReduceString(UString &s, unsigned size) { if (s.Len() > size) { diff --git a/CPP/7zip/UI/Far/FarUtils.h b/CPP/7zip/UI/Far/FarUtils.h index edec4cf9..5617c6c8 100644 --- a/CPP/7zip/UI/Far/FarUtils.h +++ b/CPP/7zip/UI/Far/FarUtils.h @@ -190,6 +190,8 @@ int ShowLastErrorMessage(); bool WasEscPressed(); +void ReduceString(UString &s, unsigned size); + } #endif diff --git a/CPP/7zip/UI/Far/OverwriteDialogFar.cpp b/CPP/7zip/UI/Far/OverwriteDialogFar.cpp index a7fb495e..e950f695 100644 --- a/CPP/7zip/UI/Far/OverwriteDialogFar.cpp +++ b/CPP/7zip/UI/Far/OverwriteDialogFar.cpp @@ -68,8 +68,17 @@ NResult::EEnum Execute(const CFileInfo &oldFileInfo, const CFileInfo &newFileInf SetFileInfoStrings(oldFileInfo, oldFileInfoStrings); SetFileInfoStrings(newFileInfo, newFileInfoStrings); - AString oldName = UnicodeStringToMultiByte(oldFileInfo.Name, CP_OEMCP); - AString newName = UnicodeStringToMultiByte(newFileInfo.Name, CP_OEMCP); + UString oldName2 = oldFileInfo.Name; + UString newName2 = newFileInfo.Name; + + { + const unsigned maxNameLen = kXSize - 9 - 2; + ReduceString(oldName2, maxNameLen); + ReduceString(newName2, maxNameLen); + } + + AString oldName = UnicodeStringToMultiByte(oldName2); + AString newName = UnicodeStringToMultiByte(newName2); struct CInitDialogItem initItems[]={ { DI_DOUBLEBOX, 3, 1, kXSize - 4, kYSize - 2, false, false, 0, false, NMessageID::kOverwriteTitle, NULL, NULL }, |