mirror of
https://github.com/Xevion/easy7zip.git
synced 2025-12-07 11:14:58 -06:00
15.05
This commit is contained in:
committed by
Kornel Lesiński
parent
0713a3ab80
commit
54490d51d5
@@ -7,21 +7,23 @@
|
||||
static UString GetDefaultName3(const UString &fileName,
|
||||
const UString &extension, const UString &addSubExtension)
|
||||
{
|
||||
int extLength = extension.Len();
|
||||
int fileNameLength = fileName.Len();
|
||||
if (fileNameLength > extLength + 1)
|
||||
const unsigned extLen = extension.Len();
|
||||
const unsigned fileNameLen = fileName.Len();
|
||||
|
||||
if (fileNameLen > extLen + 1)
|
||||
{
|
||||
int dotPos = fileNameLength - (extLength + 1);
|
||||
const unsigned dotPos = fileNameLen - (extLen + 1);
|
||||
if (fileName[dotPos] == '.')
|
||||
if (extension.IsEqualToNoCase(fileName.Ptr(dotPos + 1)))
|
||||
if (extension.IsEqualTo_NoCase(fileName.Ptr(dotPos + 1)))
|
||||
return fileName.Left(dotPos) + addSubExtension;
|
||||
}
|
||||
int dotPos = fileName.ReverseFind(L'.');
|
||||
|
||||
int dotPos = fileName.ReverseFind_Dot();
|
||||
if (dotPos > 0)
|
||||
return fileName.Left(dotPos) + addSubExtension;
|
||||
|
||||
if (addSubExtension.IsEmpty())
|
||||
return fileName + L"~";
|
||||
return fileName + L'~';
|
||||
else
|
||||
return fileName + addSubExtension;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user