From: <ki...@us...> - 2024-03-30 16:04:22
|
Revision: 7420 http://sourceforge.net/p/nsis/code/7420 Author: kichik Date: 2024-03-30 16:04:20 +0000 (Sat, 30 Mar 2024) Log Message: ----------- Fixed plug-in call overwriting SetDetailsPrint lastused (bug #1300, #1271) Modified Paths: -------------- NSIS/trunk/Source/build.cpp NSIS/trunk/Source/exehead/exec.c NSIS/trunk/Source/script.cpp Modified: NSIS/trunk/Source/build.cpp =================================================================== --- NSIS/trunk/Source/build.cpp 2024-02-07 15:53:40 UTC (rev 7419) +++ NSIS/trunk/Source/build.cpp 2024-03-30 16:04:20 UTC (rev 7420) @@ -3800,7 +3800,7 @@ // don't move this, depends on [un.] zero_offset=add_asciistring(_T("$0")); - // SetDetailsPrint none (don't update lastused) + // SetDetailsPrint none (special) ret=add_entry_direct(EW_SETFLAG, FLAG_OFFSET(status_update), add_intstring(6), -1); if (ret != PS_OK) return ret; Modified: NSIS/trunk/Source/exehead/exec.c =================================================================== --- NSIS/trunk/Source/exehead/exec.c 2024-02-07 15:53:40 UTC (rev 7419) +++ NSIS/trunk/Source/exehead/exec.c 2024-03-30 16:04:20 UTC (rev 7420) @@ -319,17 +319,25 @@ break; #endif//NSIS_CONFIG_VISIBLE_SUPPORT case EW_SETFLAG: - if (parm2 <= 0) { - if (parm2 == 0) - FIELDN(g_exec_flags_last_used,parm0)=FIELDN(g_exec_flags,parm0); - FIELDN(g_exec_flags,parm0)=GetIntFromParm(1); - log_printf3(_T("SetFlag: %d=%d"),parm0,FIELDN(g_exec_flags,parm0)); + // TODO push/pop flags instead -- https://sourceforge.net/p/nsis/patches/222/ + static int g_statusuphack = 0; + if (parm2 <= 0) + { + if (parm2 < 0) + g_statusuphack=FIELDN(g_exec_flags,parm0); + else + FIELDN(g_exec_flags_last_used,parm0)=FIELDN(g_exec_flags,parm0); + FIELDN(g_exec_flags,parm0)=GetIntFromParm(1); + log_printf3(_T("SetFlag: %d=%d"),parm0,FIELDN(g_exec_flags,parm0)); + } + else + { + FIELDN(g_exec_flags,parm0)=FIELDN(g_exec_flags_last_used,parm0); + if (parm3 < 0) + FIELDN(g_exec_flags,parm0)=g_statusuphack; + } } - else - { - FIELDN(g_exec_flags,parm0)=FIELDN(g_exec_flags_last_used,parm0); - } break; case EW_IFFLAG: { Modified: NSIS/trunk/Source/script.cpp =================================================================== --- NSIS/trunk/Source/script.cpp 2024-02-07 15:53:40 UTC (rev 7419) +++ NSIS/trunk/Source/script.cpp 2024-03-30 16:04:20 UTC (rev 7420) @@ -5132,8 +5132,8 @@ if ((ret=add_entry(&ent)) != PS_OK) return ret; } - // SetDetailsPrint lastused - ret=add_entry_direct(EW_SETFLAG, FLAG_OFFSET(status_update), 0, 1); + // SetDetailsPrint lastused (special) + ret=add_entry_direct(EW_SETFLAG, FLAG_OFFSET(status_update), 0, 1, -1); if (ret != PS_OK) return ret; // Call the DLL This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |