summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2017-08-21 09:51:16 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2017-08-21 09:49:48 +0200
commit7766135f1ca11f942eb5b9ccc7828d55acfbe28f (patch)
treee823dffb223461af9d76b588b9768940d0617459
parent12b3725aeff5d016d11853c9c8d5077f7e8f7b71 (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>
-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 043f7b2a2f5e..58583f71e45c 100644
--- a/desktop/source/app/cmdlinehelp.cxx
+++ b/desktop/source/app/cmdlinehelp.cxx
@@ -211,18 +211,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()