unicode: use short filenames when long filename doesn't work. Temporary solution for #2100

This commit is contained in:
Daniel Marjamäki 2010-10-16 12:40:21 +02:00
parent 4e121c94ab
commit 88a98a2ef0
2 changed files with 7 additions and 1 deletions

View File

@ -47,7 +47,7 @@
Optimization="0" Optimization="0"
WholeProgramOptimization="false" WholeProgramOptimization="false"
AdditionalIncludeDirectories="..\lib" AdditionalIncludeDirectories="..\lib"
PreprocessorDefinitions="_DEBUG;WIN32;_CRT_SECURE_NO_WARNINGS" PreprocessorDefinitions="_DEBUG;WIN32;_CRT_SECURE_NO_WARNINGS;UNICODE"
BasicRuntimeChecks="3" BasicRuntimeChecks="3"
RuntimeLibrary="1" RuntimeLibrary="1"
TreatWChar_tAsBuiltInType="false" TreatWChar_tAsBuiltInType="false"

View File

@ -148,6 +148,12 @@ void FileListerWin32::recursiveAddFiles(std::vector<std::string> &filenames, con
#if defined(UNICODE) #if defined(UNICODE)
char * ansiFfd = new char[wcslen(ffd.cFileName) + 1]; char * ansiFfd = new char[wcslen(ffd.cFileName) + 1];
TransformUcs2ToAnsi(ffd.cFileName, ansiFfd, wcslen(ffd.cFileName) + 1); TransformUcs2ToAnsi(ffd.cFileName, ansiFfd, wcslen(ffd.cFileName) + 1);
if (strchr(ansiFfd, '?'))
{
delete [] ansiFfd;
ansiFfd = new char[wcslen(ffd.cAlternateFileName) + 1];
TransformUcs2ToAnsi(ffd.cAlternateFileName, ansiFfd, wcslen(ffd.cAlternateFileName) + 1);
}
#else // defined(UNICODE) #else // defined(UNICODE)
char * ansiFfd = &ffd.cFileName[0]; char * ansiFfd = &ffd.cFileName[0];
#endif // defined(UNICODE) #endif // defined(UNICODE)