From d5de6a710d139441f4e6f73ee99ab50ea92876fa Mon Sep 17 00:00:00 2001 From: Alexey Date: Thu, 25 Jan 2024 00:07:00 +0300 Subject: [PATCH] Fix ZipFile func for linux --- OfficeUtils/src/ZipUtilsCP.cpp | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/OfficeUtils/src/ZipUtilsCP.cpp b/OfficeUtils/src/ZipUtilsCP.cpp index 3d0dbff1f9..7c5db7baa1 100644 --- a/OfficeUtils/src/ZipUtilsCP.cpp +++ b/OfficeUtils/src/ZipUtilsCP.cpp @@ -746,24 +746,8 @@ namespace ZLibZipUtils { zipFile zf = zipOpenHelp(outputFile); if (zf) - { - wstring inputFileName( inputFile ); - - wstring::size_type pos = 0; - static const wstring::size_type npos = -1; - - pos = inputFileName.find_last_of( L'\\' ); - - wstring zipFileName; - - if ( pos != npos ) - { - zipFileName = wstring( ( inputFileName.begin() + pos + 1 ), inputFileName.end() ); - } - else - { - zipFileName = wstring( inputFileName.begin(), inputFileName.end() ); - } + { + wstring zipFileName = NSFile::GetFileName(inputFile); std::string zipFileNameA = codepage_issue_fixToOEM(zipFileName); err = zipOpenNewFileInZip( zf, zipFileNameA.c_str(), &zinfo, NULL, 0, NULL, 0, NULL, method, compressionLevel );