diff options
Diffstat (limited to '3rdparty/lzma/CPP/7zip/UI/Common/DefaultName.cpp')
-rw-r--r-- | 3rdparty/lzma/CPP/7zip/UI/Common/DefaultName.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/3rdparty/lzma/CPP/7zip/UI/Common/DefaultName.cpp b/3rdparty/lzma/CPP/7zip/UI/Common/DefaultName.cpp index 4335e273154..02f611c3d18 100644 --- a/3rdparty/lzma/CPP/7zip/UI/Common/DefaultName.cpp +++ b/3rdparty/lzma/CPP/7zip/UI/Common/DefaultName.cpp @@ -7,21 +7,23 @@ static UString GetDefaultName3(const UString &fileName, const UString &extension, const UString &addSubExtension) { - int extLength = extension.Length(); - int fileNameLength = fileName.Length(); - 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.CompareNoCase(fileName.Mid(dotPos + 1)) == 0) + 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; } |