Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
1 // DefaultName.cpp
3 #include "StdAfx.h"
5 #include "DefaultName.h"
7 static const wchar_t *kEmptyFileAlias = L"[Content]";
9 UString GetDefaultName2(const UString &fileName,
10 const UString &extension, const UString &addSubExtension)
11 {
12 int extLength = extension.Length();
13 int fileNameLength = fileName.Length();
14 if (fileNameLength > extLength + 1)
15 {
16 int dotPos = fileNameLength - (extLength + 1);
17 if (fileName[dotPos] == '.')
18 if (extension.CompareNoCase(fileName.Mid(dotPos + 1)) == 0)
19 return fileName.Left(dotPos) + addSubExtension;
20 }
21 return kEmptyFileAlias;
22 }