mirror of
https://github.com/Xevion/easy7zip.git
synced 2025-12-08 00:06:59 -06:00
9.21
This commit is contained in:
committed by
Kornel Lesiński
parent
de4f8c22fe
commit
35596517f2
@@ -9,19 +9,19 @@
|
||||
|
||||
using namespace NWindows;
|
||||
|
||||
static UString CreateArchiveName2(const UString &srcName, bool fromPrev, bool keepName)
|
||||
static FString CreateArchiveName2(const FString &srcName, bool fromPrev, bool keepName)
|
||||
{
|
||||
UString resultName = L"Archive";
|
||||
FString resultName = FTEXT("Archive");
|
||||
if (fromPrev)
|
||||
{
|
||||
UString dirPrefix;
|
||||
FString dirPrefix;
|
||||
if (NFile::NDirectory::GetOnlyDirPrefix(srcName, dirPrefix))
|
||||
{
|
||||
if (dirPrefix.Length() > 0)
|
||||
if (dirPrefix[dirPrefix.Length() - 1] == WCHAR_PATH_SEPARATOR)
|
||||
if (dirPrefix.Back() == FCHAR_PATH_SEPARATOR)
|
||||
{
|
||||
dirPrefix.Delete(dirPrefix.Length() - 1);
|
||||
NFile::NFind::CFileInfoW fileInfo;
|
||||
dirPrefix.DeleteBack();
|
||||
NFile::NFind::CFileInfo fileInfo;
|
||||
if (fileInfo.Find(dirPrefix))
|
||||
resultName = fileInfo.Name;
|
||||
}
|
||||
@@ -29,7 +29,7 @@ static UString CreateArchiveName2(const UString &srcName, bool fromPrev, bool ke
|
||||
}
|
||||
else
|
||||
{
|
||||
NFile::NFind::CFileInfoW fileInfo;
|
||||
NFile::NFind::CFileInfo fileInfo;
|
||||
if (!fileInfo.Find(srcName))
|
||||
// return resultName;
|
||||
return srcName;
|
||||
@@ -39,8 +39,8 @@ static UString CreateArchiveName2(const UString &srcName, bool fromPrev, bool ke
|
||||
int dotPos = resultName.ReverseFind('.');
|
||||
if (dotPos > 0)
|
||||
{
|
||||
UString archiveName2 = resultName.Left(dotPos);
|
||||
if (archiveName2.ReverseFind('.') < 0)
|
||||
FString archiveName2 = resultName.Left(dotPos);
|
||||
if (archiveName2.ReverseFind(FTEXT('.')) < 0)
|
||||
resultName = archiveName2;
|
||||
}
|
||||
}
|
||||
@@ -50,5 +50,5 @@ static UString CreateArchiveName2(const UString &srcName, bool fromPrev, bool ke
|
||||
|
||||
UString CreateArchiveName(const UString &srcName, bool fromPrev, bool keepName)
|
||||
{
|
||||
return GetCorrectFsPath(CreateArchiveName2(srcName, fromPrev, keepName));
|
||||
return GetCorrectFsPath(fs2us(CreateArchiveName2(us2fs(srcName), fromPrev, keepName)));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user