advpack: Fix the full path check

James Hawkins truiken at gmail.com
Mon Oct 23 20:44:59 CDT 2006


Hi,

The test crashes without the fix.

Changelog:
* Fix the full path check.

 dlls/advpack/install.c       |    2 +-
 dlls/advpack/tests/install.c |   18 ++++++++++++++++++
 2 files changed, 19 insertions(+), 1 deletions(-)

-- 
James Hawkins
-------------- next part --------------
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();
 }
-- 
1.4.2.1


More information about the wine-patches mailing list