mirror of https://github.com/FreeRDP/FreeRDP
Merge pull request #4816 from akallabeth/drive_cmd_fix
Fix #4680: Return proper directory name.
This commit is contained in:
commit
8248dcb3bb
|
@ -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