[client,common] do not swap drive name,path for wildcards

the convenience feature to allow name,path or path,name syntax for drive
did not check for path being one of the wildcard symbols.
This commit is contained in:
Armin Novak
2023-07-31 09:42:44 +02:00
committed by Martin Fleisz
parent 97cb8d9e57
commit 10386e73bc

View File

@@ -170,8 +170,21 @@ static BOOL freerdp_client_add_drive(rdpSettings* settings, const char* path, co
if (name)
{
BOOL skip = FALSE;
if (path)
{
switch (path[0])
{
case '*':
case '%':
skip = TRUE;
break;
default:
break;
}
}
/* Path was entered as secondary argument, swap */
if (winpr_PathFileExists(name))
if (!skip && winpr_PathFileExists(name))
{
if (!winpr_PathFileExists(path) || (!PathIsRelativeA(name) && PathIsRelativeA(path)))
{