diff --git a/Docs/src/history.but b/Docs/src/history.but index ae79ae22..99aa79b0 100644 --- a/Docs/src/history.but +++ b/Docs/src/history.but @@ -16,6 +16,8 @@ ANSI targets are deprecated, consider moving to Unicode. \b Added \R{loadandsetimage}{LoadAndSetImage} +\b Fixed -O stderr stream issue (\W{http://sf.net/p/nsis/bugs/1221}{bug #1221}) + \S2{} Translations \b Updated Hindi (\W{http://sf.net/p/nsis/patches/291}{patch #291}) and Portuguese (\W{http://sf.net/p/nsis/bugs/1219}{bug #1219}) diff --git a/Source/makenssi.cpp b/Source/makenssi.cpp index 4afb860c..813adb09 100644 --- a/Source/makenssi.cpp +++ b/Source/makenssi.cpp @@ -70,8 +70,10 @@ static void myatexit() { dopause(); ResetPrintColor(); - if (g_output != stdout && g_output) fclose(g_output), g_output = 0; - if (g_errout != stderr && g_errout) fclose(g_errout), g_errout = 0; + bool oneoutputstream = g_output == g_errout; + if (g_output != stdout && g_output ) fclose(g_output); + if (g_errout != stderr && g_errout && !oneoutputstream) fclose(g_errout); + g_output = g_errout = 0; #ifdef _WIN32 SetConsoleOutputCP(g_wincon_orgoutcp); #endif