Code inside the block which fills argc/argv is already guarded and prevents
duplicate code execution. So move the duplicate_ppstrings() here.
---
mingw-w64-crt/crt/crtexe.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/mingw-w64-crt/crt/crtexe.c b/mingw-w64-crt/crt/crtexe.c
index 46e61fcecb94..1f3ad3a7a2b8 100644
--- a/mingw-w64-crt/crt/crtexe.c
+++ b/mingw-w64-crt/crt/crtexe.c
@@ -207,6 +207,8 @@ __tmainCRTStartup (void)
if (ret < 0)
_amsg_exit (8); /* _RT_SPACEARG */
+ duplicate_ppstrings (argc, &argv);
+
_initterm (__xc_a, __xc_z);
__main (); /* C++ initialization. */
@@ -229,7 +231,6 @@ __tmainCRTStartup (void)
_fpreset ();
- duplicate_ppstrings (argc, &argv);
#ifdef _UNICODE
__winitenv = envp;
#else
--
2.20.1
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public