From 29f5727b83c4ec26ff8e183c1b0dc707a3719588 Mon Sep 17 00:00:00 2001 From: Pauli Date: Fri, 7 May 2021 14:19:06 +1000 Subject: [PATCH] apps/mac: avoid need for two ^D when using stdin from a terminal Fixes #13246 Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/15189) --- apps/mac.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/apps/mac.c b/apps/mac.c index dccbb681172..b9610f3a185 100644 --- a/apps/mac.c +++ b/apps/mac.c @@ -150,10 +150,11 @@ opthelp: goto err; } - for (;;) { + while (BIO_pending(in) || !BIO_eof(in)) { i = BIO_read(in, (char *)buf, BUFSIZE); if (i < 0) { BIO_printf(bio_err, "Read Error in '%s'\n", infile); + ERR_print_errors(bio_err); goto err; } if (i == 0) -- 2.47.2