aboutsummaryrefslogtreecommitdiff
path: root/crypto
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>1999-03-05 01:07:04 +0000
committerDr. Stephen Henson <steve@openssl.org>1999-03-05 01:07:04 +0000
commitd00b7aad5add9864147635279b951fbe8a7656b7 (patch)
treebadb19637cf4d2d68b465857e851984eaeafbd38 /crypto
parent9985bed331b388e871a89cf043ae21c1177eaa24 (diff)
downloadopenssl-d00b7aad5add9864147635279b951fbe8a7656b7.zip
openssl-d00b7aad5add9864147635279b951fbe8a7656b7.tar.gz
openssl-d00b7aad5add9864147635279b951fbe8a7656b7.tar.bz2
Workaround for a Win95 console bug triggered by the password read stuff.
Diffstat (limited to 'crypto')
-rw-r--r--crypto/des/read_pwd.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/crypto/des/read_pwd.c b/crypto/des/read_pwd.c
index 3041ab2..edfa456 100644
--- a/crypto/des/read_pwd.c
+++ b/crypto/des/read_pwd.c
@@ -63,6 +63,11 @@
#include <graph.h>
#endif
+#if defined(WIN32) && !defined(WINNT)
+#define WIN_CONSOLE_BUG
+#endif
+
+
/* 06-Apr-92 Luke Brennan Support for VMS */
#include "des_locl.h"
#include <signal.h>
@@ -70,6 +75,12 @@
#include <setjmp.h>
#include <errno.h>
+#ifdef WIN_CONSOLE_BUG
+#include <windows.h>
+#include <wincon.h>
+#endif
+
+
/* There are 5 types of terminal interface supported,
* TERMIO, TERMIOS, VMS, MSDOS and SGTTY
*/
@@ -462,6 +473,18 @@ FILE *tty;
break;
}
}
+#ifdef WIN_CONSOLE_BUG
+/* Win95 has several evil console bugs: one of these is that the
+ * last character read using getch() is passed to the next read: this is
+ * usually a CR so this can be trouble. No STDIO fix seems to work but
+ * flushing the console appears to do the trick.
+ */
+ {
+ HANDLE inh;
+ inh = GetStdHandle(STD_INPUT_HANDLE);
+ FlushConsoleInputBuffer(inh);
+ }
+#endif
return(strlen(buf));
}
#endif