Module: wine Branch: master Commit: 615d09f285015e392c66c5873e97c871323f9144 URL: http://source.winehq.org/git/wine.git/?a=commit;h=615d09f285015e392c66c5873e...
Author: James Hawkins truiken@gmail.com Date: Mon Oct 23 18:44:59 2006 -0700
advpack: Fix the full path check.
---
dlls/advpack/install.c | 2 +- dlls/advpack/tests/install.c | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+), 1 deletions(-)
diff --git a/dlls/advpack/install.c b/dlls/advpack/install.c index d63a959..b86c70a 100644 --- a/dlls/advpack/install.c +++ b/dlls/advpack/install.c @@ -221,7 +221,7 @@ static BOOL is_full_path(LPWSTR path) if (!path || lstrlenW(path) < MIN_PATH_LEN) return FALSE;
- if (path[1] == ':' || (path[0] == '\' && path[1] == '\')) + if ((path[1] == ':' && path[2] == '\') || (path[0] == '\' && path[1] == '\')) return TRUE;
return FALSE; diff --git a/dlls/advpack/tests/install.c b/dlls/advpack/tests/install.c index 00ed378..b594a1e 100644 --- a/dlls/advpack/tests/install.c +++ b/dlls/advpack/tests/install.c @@ -226,6 +226,23 @@ static void test_LaunchINFSection() DeleteFileA("test.inf"); }
+static void test_LaunchINFSectionEx() +{ + HRESULT hr; + char cmdline[MAX_PATH]; + + create_inf_file("test.inf"); + + /* try an invalid CAB filename */ + lstrcpy(cmdline, CURR_DIR); + lstrcpy(cmdline, "\"); + lstrcpy(cmdline, "test.inf,DefaultInstall,c:imacab.cab,4"); + hr = pLaunchINFSectionEx(NULL, NULL, cmdline, 0); + ok(hr == 0, "Expected 0, got %d\n", hr); + + DeleteFileA("test.inf"); +} + START_TEST(install) { if (!init_function_pointers()) @@ -235,4 +252,5 @@ START_TEST(install)
test_RunSetupCommand(); test_LaunchINFSection(); + test_LaunchINFSectionEx(); }