attempted to fix special char problems in Windows (see #751)

This commit is contained in:
thrust26 2021-01-05 10:04:12 +01:00
parent 3a1df0e99b
commit c0647d7a22
1 changed files with 6 additions and 1 deletions

View File

@ -93,8 +93,13 @@ void FilesystemNodeWINDOWS::addFile(AbstractFSList& list, ListMode mode,
{ {
FilesystemNodeWINDOWS entry; FilesystemNodeWINDOWS entry;
char* asciiName = toAscii(find_data->cFileName); char* asciiName = toAscii(find_data->cFileName);
// Use short 8.3 name for the path to handle special chars
char* shortAsciiName = toAscii(find_data->cAlternateFileName);
bool isDirectory, isFile; bool isDirectory, isFile;
if(!strlen(shortAsciiName))
shortAsciiName = asciiName;
// Skip local directory (.) and parent (..) // Skip local directory (.) and parent (..)
if(!strncmp(asciiName, ".", 1) || !strncmp(asciiName, "..", 2)) if(!strncmp(asciiName, ".", 1) || !strncmp(asciiName, "..", 2))
return; return;
@ -110,7 +115,7 @@ void FilesystemNodeWINDOWS::addFile(AbstractFSList& list, ListMode mode,
entry._isFile = isFile; entry._isFile = isFile;
entry._displayName = asciiName; entry._displayName = asciiName;
entry._path = base; entry._path = base;
entry._path += asciiName; entry._path += shortAsciiName;
if(entry._isDirectory) if(entry._isDirectory)
entry._path += "\\"; entry._path += "\\";
entry._isValid = true; entry._isValid = true;