mirror of
https://github.com/monero-project/monero.git
synced 2024-12-23 20:19:34 +00:00
password: fix secure input with echo on windows
Thanks to iDunk for the testing back and forth
This commit is contained in:
parent
77ef8c1839
commit
067e232b19
1 changed files with 6 additions and 2 deletions
|
@ -60,7 +60,7 @@ namespace
|
||||||
|
|
||||||
DWORD mode_old;
|
DWORD mode_old;
|
||||||
::GetConsoleMode(h_cin, &mode_old);
|
::GetConsoleMode(h_cin, &mode_old);
|
||||||
DWORD mode_new = mode_old & ~((hide_input ? ENABLE_ECHO_INPUT : 0) | ENABLE_LINE_INPUT);
|
DWORD mode_new = mode_old & ~(hide_input ? ENABLE_ECHO_INPUT : 0);
|
||||||
::SetConsoleMode(h_cin, mode_new);
|
::SetConsoleMode(h_cin, mode_new);
|
||||||
|
|
||||||
bool r = true;
|
bool r = true;
|
||||||
|
@ -78,7 +78,11 @@ namespace
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
else if (ucs2_ch == L'\n' || ucs2_ch == L'\r')
|
else if (ucs2_ch == L'\r')
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
else if (ucs2_ch == L'\n')
|
||||||
{
|
{
|
||||||
std::cout << std::endl;
|
std::cout << std::endl;
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue