From 9d79746425ba2e292f85f656227d703672076499 Mon Sep 17 00:00:00 2001 From: Zhipeng Zhao Date: Fri, 27 Mar 2020 15:14:52 +0800 Subject: [PATCH] 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 Signed-off-by: Alexandre Julliard --- programs/explorer/explorer.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/programs/explorer/explorer.c b/programs/explorer/explorer.c index dcd09ac969e..763fca381b7 100644 --- a/programs/explorer/explorer.c +++ b/programs/explorer/explorer.c @@ -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 );