Commit 71e5f3c1 authored by Francois Gouget's avatar Francois Gouget Committed by Alexandre Julliard

shell32: Fix FindExecutable() to return the executable path, not the whole command.

parent 65b81beb
......@@ -707,6 +707,16 @@ UINT SHELL_FindExecutable(LPCWSTR lpPath, LPCWSTR lpFile, LPCWSTR lpOperation,
}
*p = '\0';
}
else
{
/* Truncate on first space, like Windows:
* http://support.microsoft.com/?scid=kb%3Ben-us%3B140724
*/
WCHAR *p = lpResult;
while (*p != ' ' && *p != '\0')
p++;
*p='\0';
}
}
}
else /* Check win.ini */
......
......@@ -498,24 +498,24 @@ static filename_tests_t filename_tests[]=
{NULL, "%s\\nonexistent.noassoc", 0x11, SE_ERR_FNF},
/* Standard tests */
{NULL, "%s\\test file.shlexec", 0x20, 33},
{NULL, "%s\\test file.shlexec.", 0x20, 33},
{NULL, "%s\\%%nasty%% $file.shlexec", 0x20, 33},
{NULL, "%s/test file.shlexec", 0x20, 33},
{NULL, "%s\\test file.shlexec", 0x0, 33},
{NULL, "%s\\test file.shlexec.", 0x0, 33},
{NULL, "%s\\%%nasty%% $file.shlexec", 0x0, 33},
{NULL, "%s/test file.shlexec", 0x0, 33},
/* Test filenames with no association */
{NULL, "%s\\test file.noassoc", 0x0, SE_ERR_NOASSOC},
/* Test double extensions */
{NULL, "%s\\test file.noassoc.shlexec", 0x20, 33},
{NULL, "%s\\test file.noassoc.shlexec", 0x0, 33},
{NULL, "%s\\test file.shlexec.noassoc", 0x0, SE_ERR_NOASSOC},
/* Test alternate verbs */
{"LowerL", "%s\\nonexistent.shlexec", 0x11, SE_ERR_FNF},
{"LowerL", "%s\\test file.noassoc", 0x0, SE_ERR_NOASSOC},
{"QuotedLowerL", "%s\\test file.shlexec", 0x20, 33},
{"QuotedUpperL", "%s\\test file.shlexec", 0x20, 33},
{"QuotedLowerL", "%s\\test file.shlexec", 0x0, 33},
{"QuotedUpperL", "%s\\test file.shlexec", 0x0, 33},
{NULL, NULL, 0}
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment