Commit 968a4457 authored by Mike McCormack's avatar Mike McCormack Committed by Alexandre Julliard

cabinet: Split the cabinet path for FDICopy.

parent 9d9ae2e5
...@@ -303,7 +303,7 @@ HRESULT WINAPI Extract(EXTRACTdest *dest, LPCSTR szCabName) ...@@ -303,7 +303,7 @@ HRESULT WINAPI Extract(EXTRACTdest *dest, LPCSTR szCabName)
HRESULT res = S_OK; HRESULT res = S_OK;
HFDI hfdi; HFDI hfdi;
ERF erf; ERF erf;
static CHAR empty[] = ""; char *str, *path, *name;
TRACE("(%p, %s)\n", dest, szCabName); TRACE("(%p, %s)\n", dest, szCabName);
...@@ -323,10 +323,32 @@ HRESULT WINAPI Extract(EXTRACTdest *dest, LPCSTR szCabName) ...@@ -323,10 +323,32 @@ HRESULT WINAPI Extract(EXTRACTdest *dest, LPCSTR szCabName)
if (GetFileAttributesA(dest->directory) == INVALID_FILE_ATTRIBUTES) if (GetFileAttributesA(dest->directory) == INVALID_FILE_ATTRIBUTES)
return S_OK; return S_OK;
if (!FDICopy(hfdi, (LPSTR)szCabName, empty, 0, /* split the cabinet name into path + name */
str = HeapAlloc(GetProcessHeap(), 0, lstrlenA(szCabName)+1);
if (!str)
{
res = E_OUTOFMEMORY;
goto end;
}
lstrcpyA(str, szCabName);
path = str;
name = strrchr(path, '\\');
if (name)
*name++ = 0;
else
{
name = path;
path = NULL;
}
if (!FDICopy(hfdi, name, path, 0,
fdi_notify_extract, NULL, dest)) fdi_notify_extract, NULL, dest))
res = E_FAIL; res = E_FAIL;
HeapFree(GetProcessHeap(), 0, str);
end:
FDIDestroy(hfdi); FDIDestroy(hfdi);
return res; return res;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment