[PATCH] explorer: Add parsing '/cd' arg in explorer commandline
There is some application use explorer open some folder with '/cd' arg instead of '/select' arg, in this case explorer cannot work as expect. In this patch, the arg will be ignored. Signed-off-by: Zhipeng Zhao <near2see(a)163.com> --- programs/explorer/explorer.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/programs/explorer/explorer.c b/programs/explorer/explorer.c index dcd09ac969..3cef83f285 100644 --- a/programs/explorer/explorer.c +++ b/programs/explorer/explorer.c @@ -729,6 +729,7 @@ static void parse_command_line(LPWSTR commandline,parameters_struct *parameters) static const WCHAR arg_select[] = {'/','s','e','l','e','c','t',','}; static const WCHAR arg_desktop[] = {'/','d','e','s','k','t','o','p'}; static const WCHAR arg_desktop_quotes[] = {'"','/','d','e','s','k','t','o','p'}; + static const WCHAR arg_cd[] = {'/','c','d',','}; LPWSTR p = commandline; @@ -769,6 +770,11 @@ static void parse_command_line(LPWSTR commandline,parameters_struct *parameters) p += ARRAY_SIZE( arg_desktop_quotes ); manage_desktop( p ); /* the rest of the command line is handled by desktop mode */ } + else if (wcsncmp(p, arg_cd, ARRAY_SIZE( arg_cd ))==0) + { + p += ARRAY_SIZE( arg_cd ); + p = copy_path_string(parameters->selection,p); + } else { /* left over command line is generally the path to be opened */ -- 2.20.1
participants (1)
-
Zhipeng Zhao