advpack: Fix the full path check.

This commit is contained in:
James Hawkins 2006-10-23 18:44:59 -07:00 committed by Alexandre Julliard
parent 1f3f88bf67
commit 615d09f285
2 changed files with 19 additions and 1 deletions

View file

@ -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;

View file

@ -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();
}