1
0
mirror of https://github.com/facebook/zstd.git synced 2025-07-29 11:21:22 +03:00

Use IS_CONSOLE macro to detect that we're indeed using a console

This commit is contained in:
senhuang42
2020-09-22 14:15:52 -04:00
parent 05622992d5
commit 7aa3da1cd7
2 changed files with 4 additions and 1 deletions

View File

@ -90,6 +90,10 @@ int g_utilDisplayLevel;
int UTIL_requireUserConfirmation(const char* prompt, const char* abortMsg,
const char* acceptableLetters) {
int ch, result;
/* If input is presented via stdin, dont use prompt as it may swallow characters */
if (!IS_CONSOLE(stdin))
return 0;
UTIL_DISPLAY("%s", prompt);
ch = getchar();
result = 0;