Module: wine Branch: master Commit: 35ac0e7ac0511ef766f3f35220869565ce07906e URL: https://gitlab.winehq.org/wine/wine/-/commit/35ac0e7ac0511ef766f3f3522086956...
Author: Rémi Bernon rbernon@codeweavers.com Date: Mon Jan 22 18:46:40 2024 +0100
setupapi: Don't clobber the original filename if .inf is found.
---
dlls/setupapi/misc.c | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-)
diff --git a/dlls/setupapi/misc.c b/dlls/setupapi/misc.c index 701801f7380..b1083fca665 100644 --- a/dlls/setupapi/misc.c +++ b/dlls/setupapi/misc.c @@ -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) {