Alexandre Julliard : explorer: Treat unrecognized options as a file to open.
Alexandre Julliard
julliard at wine.codeweavers.com
Tue Nov 24 10:41:08 CST 2015
Module: wine
Branch: master
Commit: 9db3444e4070025162a87cce49ca7fe9ef44ce56
URL: http://source.winehq.org/git/wine.git/?a=commit;h=9db3444e4070025162a87cce49ca7fe9ef44ce56
Author: Alexandre Julliard <julliard at winehq.org>
Date: Tue Nov 24 17:36:53 2015 +0900
explorer: Treat unrecognized options as a file to open.
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
programs/explorer/explorer.c | 22 +++++++++-------------
1 file changed, 9 insertions(+), 13 deletions(-)
diff --git a/programs/explorer/explorer.c b/programs/explorer/explorer.c
index 4f82ded..c178017 100644
--- a/programs/explorer/explorer.c
+++ b/programs/explorer/explorer.c
@@ -683,12 +683,11 @@ 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'};
- LPWSTR p, p2;
+ LPWSTR p = commandline;
- p2 = commandline;
- p = strchrW(commandline,'/');
- while(p)
+ while (*p)
{
+ while (isspaceW(*p)) p++;
if (strncmpW(p, arg_n, sizeof(arg_n)/sizeof(WCHAR))==0)
{
parameters->explorer_mode = FALSE;
@@ -717,15 +716,12 @@ static void parse_command_line(LPWSTR commandline,parameters_struct *parameters)
p += sizeof(arg_desktop)/sizeof(WCHAR);
manage_desktop( p ); /* the rest of the command line is handled by desktop mode */
}
- else p++;
-
- p2 = p;
- p = strchrW(p,'/');
- }
- if (p2 && *p2)
- {
- /* left over command line is generally the path to be opened */
- copy_path_string(parameters->root,p2);
+ else
+ {
+ /* left over command line is generally the path to be opened */
+ copy_path_string(parameters->root,p);
+ break;
+ }
}
}
More information about the wine-cvs
mailing list