1 diff -uNr unrar.mod/consio.cpp unrar.mod2/consio.cpp
2 --- unrar.mod/consio.cpp 2017-08-11 16:56:22.000000000 +0300
3 +++ unrar.mod2/consio.cpp 2017-09-14 20:34:17.247733000 +0300
10 +#include <readline/readline.h>
12 static MESSAGE_TYPE MsgStream=MSG_STDOUT;
13 static RAR_CHARSET RedirectCharset=RCH_DEFAULT;
20 +static char* getpass(const char *prompt) {
21 + struct termios term_old, term_new;
24 + /* Turn echoing off and fail if we can't. */
25 + if (tcgetattr (0, &term_old) != 0) {
29 + term_new = term_old;
30 + term_new.c_lflag &= ~ECHO;
32 + if (tcsetattr (0, TCSAFLUSH, &term_new) != 0) {
36 + /* Read the password. */
37 + char *password = readline(prompt);
39 + /* Restore terminal. */
40 + (void) tcsetattr (0, TCSAFLUSH, &term_old);
45 static void cvt_wprintf(FILE *dest,const wchar *fmt,va_list arglist)
47 // This buffer is for format string only, not for entire output,