explorer: Support '/cd,' command line option.

'/cd,' is an undocumented option that seems to have the same effect as
'/root,'.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=48816.
Signed-off-by: Zhiyi Zhang <zzhang@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zhipeng Zhao 2020-03-27 15:14:52 +08:00 committed by Alexandre Julliard
parent 59c7e1977c
commit 9d79746425
1 changed files with 7 additions and 0 deletions

View File

@ -718,6 +718,7 @@ static void copy_path_root(LPWSTR root, LPWSTR path)
* Command Line parameters are:
* [/n] Opens in single-paned view for each selected items. This is default
* [/e,] Uses Windows Explorer View
* [/cd,object] Specifies the root level of the view
* [/root,object] Specifies the root level of the view
* [/select,object] parent folder is opened and specified object is selected
*/
@ -725,6 +726,7 @@ static void parse_command_line(LPWSTR commandline,parameters_struct *parameters)
{
static const WCHAR arg_n[] = {'/','n'};
static const WCHAR arg_e[] = {'/','e',','};
static const WCHAR arg_cd[] = {'/','c','d',','};
static const WCHAR arg_root[] = {'/','r','o','o','t',','};
static const WCHAR arg_select[] = {'/','s','e','l','e','c','t',','};
static const WCHAR arg_desktop[] = {'/','d','e','s','k','t','o','p'};
@ -745,6 +747,11 @@ static void parse_command_line(LPWSTR commandline,parameters_struct *parameters)
parameters->explorer_mode = TRUE;
p += ARRAY_SIZE( arg_e );
}
else if (wcsncmp(p, arg_cd, ARRAY_SIZE( arg_cd ))==0)
{
p += ARRAY_SIZE( arg_cd );
p = copy_path_string(parameters->root,p);
}
else if (wcsncmp(p, arg_root, ARRAY_SIZE( arg_root ))==0)
{
p += ARRAY_SIZE( arg_root );