Francois Gouget : shell32: Fix FindExecutable()
to return the executable path, not the whole command.
Alexandre Julliard
julliard at wine.codeweavers.com
Thu Dec 14 07:03:41 CST 2006
Module: wine
Branch: master
Commit: 71e5f3c116ac4a299a7fa181386f6a9997e2438e
URL: http://source.winehq.org/git/wine.git/?a=commit;h=71e5f3c116ac4a299a7fa181386f6a9997e2438e
Author: Francois Gouget <fgouget at codeweavers.com>
Date: Wed Dec 13 18:06:45 2006 +0100
shell32: Fix FindExecutable() to return the executable path, not the whole command.
---
dlls/shell32/shlexec.c | 10 ++++++++++
dlls/shell32/tests/shlexec.c | 14 +++++++-------
2 files changed, 17 insertions(+), 7 deletions(-)
diff --git a/dlls/shell32/shlexec.c b/dlls/shell32/shlexec.c
index 940ce40..0d29395 100644
--- a/dlls/shell32/shlexec.c
+++ b/dlls/shell32/shlexec.c
@@ -707,6 +707,16 @@ UINT SHELL_FindExecutable(LPCWSTR lpPath
}
*p = '\0';
}
+ else
+ {
+ /* Truncate on first space, like Windows:
+ * http://support.microsoft.com/?scid=kb%3Ben-us%3B140724
+ */
+ WCHAR *p = lpResult;
+ while (*p != ' ' && *p != '\0')
+ p++;
+ *p='\0';
+ }
}
}
else /* Check win.ini */
diff --git a/dlls/shell32/tests/shlexec.c b/dlls/shell32/tests/shlexec.c
index cb05217..4375a9a 100644
--- a/dlls/shell32/tests/shlexec.c
+++ b/dlls/shell32/tests/shlexec.c
@@ -498,24 +498,24 @@ static filename_tests_t filename_tests[]
{NULL, "%s\\nonexistent.noassoc", 0x11, SE_ERR_FNF},
/* Standard tests */
- {NULL, "%s\\test file.shlexec", 0x20, 33},
- {NULL, "%s\\test file.shlexec.", 0x20, 33},
- {NULL, "%s\\%%nasty%% $file.shlexec", 0x20, 33},
- {NULL, "%s/test file.shlexec", 0x20, 33},
+ {NULL, "%s\\test file.shlexec", 0x0, 33},
+ {NULL, "%s\\test file.shlexec.", 0x0, 33},
+ {NULL, "%s\\%%nasty%% $file.shlexec", 0x0, 33},
+ {NULL, "%s/test file.shlexec", 0x0, 33},
/* Test filenames with no association */
{NULL, "%s\\test file.noassoc", 0x0, SE_ERR_NOASSOC},
/* Test double extensions */
- {NULL, "%s\\test file.noassoc.shlexec", 0x20, 33},
+ {NULL, "%s\\test file.noassoc.shlexec", 0x0, 33},
{NULL, "%s\\test file.shlexec.noassoc", 0x0, SE_ERR_NOASSOC},
/* Test alternate verbs */
{"LowerL", "%s\\nonexistent.shlexec", 0x11, SE_ERR_FNF},
{"LowerL", "%s\\test file.noassoc", 0x0, SE_ERR_NOASSOC},
- {"QuotedLowerL", "%s\\test file.shlexec", 0x20, 33},
- {"QuotedUpperL", "%s\\test file.shlexec", 0x20, 33},
+ {"QuotedLowerL", "%s\\test file.shlexec", 0x0, 33},
+ {"QuotedUpperL", "%s\\test file.shlexec", 0x0, 33},
{NULL, NULL, 0}
};
More information about the wine-cvs
mailing list