Commit 35ac0e7a authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

setupapi: Don't clobber the original filename if .inf is found.

parent dd44e2e6
......@@ -1068,23 +1068,20 @@ BOOL WINAPI SetupCopyOEMInfW( PCWSTR source, PCWSTR location,
if (!(ret = CopyFileW( source, target, TRUE )))
return ret;
wcscpy(pnf_path, target);
PathRemoveExtensionW(pnf_path);
PathAddExtensionW(pnf_path, L".pnf");
if ((pnf_file = _wfopen(pnf_path, L"w")))
{
fputws(PNF_HEADER, pnf_file);
fputws(source, pnf_file);
fclose(pnf_file);
}
done:
if (style & SP_COPY_DELETESOURCE)
DeleteFileW( source );
if (ret)
{
wcscpy(pnf_path, target);
PathRemoveExtensionW(pnf_path);
PathAddExtensionW(pnf_path, L".pnf");
if ((pnf_file = _wfopen(pnf_path, L"w")))
{
fputws(PNF_HEADER, pnf_file);
fputws(source, pnf_file);
fclose(pnf_file);
}
}
size = lstrlenW( target ) + 1;
if (dest)
{
......
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