summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2017-08-21 09:51:16 +0300
committerMichael Stahl <mstahl@redhat.com>2017-08-22 16:55:43 +0200
commitae5accf8e7280c83e95d64cdfbe6fb0729a67b8d (patch)
treece092ad7b0b8a5d731d19a0e533ea53042a2121c
parenteec2e2b4fa1bbac557b6bec397e47640844b8101 (diff)
tdf#111908: only freopen if we try to use another console
Change-Id: If513faa4aac03b4c41759445e34cc965ece0b48e Reviewed-on: https://gerrit.libreoffice.org/41378 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> (cherry picked from commit 7766135f1ca11f942eb5b9ccc7828d55acfbe28f) Reviewed-on: https://gerrit.libreoffice.org/41379 Reviewed-by: Michael Stahl <mstahl@redhat.com>
-rw-r--r--desktop/source/app/cmdlinehelp.cxx18
1 files changed, 9 insertions, 9 deletions
diff --git a/desktop/source/app/cmdlinehelp.cxx b/desktop/source/app/cmdlinehelp.cxx
index 83baa1df21ab..46910379e7bc 100644
--- a/desktop/source/app/cmdlinehelp.cxx
+++ b/desktop/source/app/cmdlinehelp.cxx
@@ -209,18 +209,18 @@ namespace desktop
SetConsoleScreenBufferSize(hOut, cinfo.dwSize);
}
}
- }
- freopen("CON", "r", stdin);
- freopen("CON", "w", stdout);
- freopen("CON", "w", stderr);
+ freopen("CON", "r", stdin);
+ freopen("CON", "w", stdout);
+ freopen("CON", "w", stderr);
- std::ios::sync_with_stdio(true);
+ std::ios::sync_with_stdio(true);
- // In case we use parent's console, emit an empty string
- // to avoid output on a line with command prompt
- if (mConsoleMode == attached)
- fprintf(stdout, "\n");
+ // In case we use parent's console, emit an empty string
+ // to avoid output on a line with command prompt
+ if (mConsoleMode == attached)
+ fprintf(stdout, "\n");
+ }
}
~lcl_Console()