[PATCH] explorer: add support for /cd

Ilie Halip ilie.halip at gmail.com
Wed Apr 1 06:37:50 CDT 2020


This option is implemented in the same way as /root.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=48816
Signed-off-by: Ilie Halip <ilie.halip at gmail.com>
---
 programs/explorer/explorer.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/programs/explorer/explorer.c b/programs/explorer/explorer.c
index dcd09ac969..f4c5c74af1 100644
--- a/programs/explorer/explorer.c
+++ b/programs/explorer/explorer.c
@@ -720,6 +720,7 @@ static void copy_path_root(LPWSTR root, LPWSTR path)
  * [/e,] Uses Windows Explorer View
  * [/root,object] Specifies the root level of the view
  * [/select,object] parent folder is opened and specified object is selected
+ * [/cd,object] Behaves like /root
  */
 static void parse_command_line(LPWSTR commandline,parameters_struct *parameters)
 {
@@ -729,6 +730,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 +771,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->root,p);
+        }
         else
         {
             /* left over command line is generally the path to be opened */
-- 
2.17.1




More information about the wine-devel mailing list