Commit a3d87506b7 for openssl.org
commit a3d87506b75c7b647da0c0c3e709d2f870397567
Author: Milan Broz <gmazyland@gmail.com>
Date: Mon May 4 14:13:27 2026 +0000
ui_openssl.c: remove unreachable _WIN32
noecho_fgets() is enclosed by
#if defined(OPENSSL_SYS_MSDOS) && !defined(_WIN32)
The inner #if defined(_WIN32) is unreachable
#if defined(_WIN32)
i = _getch();
#else
i = getch();
#endif
Remove it.
Verified by cross compilation under DJGPP which is AFAIK the only
MSDOS/non-WIN32 environment we can use.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Reviewed-by: Saša NedvÄ›dický <sashan@openssl.org>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
MergeDate: Thu May 7 20:11:18 2026
(Merged from https://github.com/openssl/openssl/pull/31076)
diff --git a/crypto/ui/ui_openssl.c b/crypto/ui/ui_openssl.c
index 41823a739f..1da5369287 100644
--- a/crypto/ui/ui_openssl.c
+++ b/crypto/ui/ui_openssl.c
@@ -665,11 +665,7 @@ static int noecho_fgets(char *buf, int size, FILE *tty)
break;
}
size--;
-#if defined(_WIN32)
- i = _getch();
-#else
i = getch();
-#endif
if (i == '\r')
i = '\n';
*(p++) = i;