diff --git a/db_bridge/console.cpp b/db_bridge/console.cpp --- a/db_bridge/console.cpp +++ b/db_bridge/console.cpp @@ -1,5 +1,14 @@ #include +#include +#ifdef WIN32 +#include +int Console::getch () +{ + return::getch (); +} +#else +#include int Console::getch () { static int ch = -1, fd = 0; @@ -14,6 +23,7 @@ tcsetattr (fd, TCSANOW, &alt); return ch; } +#endif void Console::getpass (std::string & password) { @@ -21,9 +31,9 @@ int c; char buffer[17]; - while ((c = getch ()) != '\n' && i < 17) { + while ((c = Console::getch ()) != '\n' && i < 17) { buffer[i++] = c; - std::cout << "*"; + std::cout << "\b*"; } buffer[i] = 0;