]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
ui_openssl.c: remove unreachable _WIN32
authorMilan Broz <gmazyland@gmail.com>
Mon, 4 May 2026 14:13:27 +0000 (14:13 +0000)
committerNeil Horman <nhorman@openssl.org>
Thu, 7 May 2026 20:10:50 +0000 (16:10 -0400)
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)

crypto/ui/ui_openssl.c

index 41823a739f4014c097aecea06ae863d4604d6278..1da5369287e750de37f836f819c221b21437396c 100644 (file)
@@ -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;