Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/kornelski/7z.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Pavlov <ipavlov@users.sourceforge.net>2015-12-31 03:00:00 +0300
committerKornel LesiƄski <kornel@geekhood.net>2016-05-28 02:16:58 +0300
commit9608215ad8deb58355bae27692669fda067c4f43 (patch)
tree1227131a3f19bc36e5da4ba11791154d05cc08af /CPP/7zip/UI/Far
parent5de23c1deb52b8be4c43ad9f694c64bbddd0c38a (diff)
15.1315.13
Diffstat (limited to 'CPP/7zip/UI/Far')
-rw-r--r--CPP/7zip/UI/Far/FarUtils.cpp2
-rw-r--r--CPP/7zip/UI/Far/FarUtils.h2
-rw-r--r--CPP/7zip/UI/Far/OverwriteDialogFar.cpp13
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 },