Fix #4680: Return proper directory name.
This commit is contained in:
parent
d093189ac0
commit
ab18f8f222
@ -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++)
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user