Fix #4680: Return proper directory name.

This commit is contained in:
Armin Novak 2018-08-23 10:04:26 +02:00
parent d093189ac0
commit ab18f8f222
2 changed files with 17 additions and 2 deletions

View File

@ -53,8 +53,8 @@
static void drive_file_fix_path(WCHAR* path)
{
int i;
int length;
size_t i;
size_t length;
length = (int) _wcslen(path);
for (i = 0; i < length; i++)

View File

@ -933,7 +933,22 @@ HANDLE FindFirstFileA(LPCSTR lpFileName, LPWIN32_FIND_DATAA lpFindFileData)
}
if (FindNextFileA((HANDLE) pFileSearch, lpFindFileData))
{
if (isDir)
{
char* name = strrchr(lpFileName, '/');
if (!name)
name = lpFileName;
else
name++;
pFileSearch->lpPattern[0] = '*';
strcpy(lpFindFileData->cFileName, name);
}
return (HANDLE) pFileSearch;
}
FindClose(pFileSearch);
return INVALID_HANDLE_VALUE;