Hi Simon, > I can't get the Windows port of getpass in gnulib to work under Wine. > The call to _getch always return -1. It works fine when run on native > Windows (XP) though. Do you have any ideas? > > I propose the patch below.
If Wine behaves differently than Windows, isn't it Wine's behaviour which should be fixed in the first place? Have you reported a Wine bug? When I see http://cvs.winehq.com/cvsweb/wine/dlls/msvcrt/console.c it appears that getch() should work fine, including extended keys and special characters. Maybe the difference is not about Wine vs. Windows, but about tty vs. console? Have you tried running your test cases inside a Cygwin xterm or mingw rxvt on Windows? > It will make the code fall back to getc when > _getch appears unusable (under Wine). The code would be prettier and easier to understand if the fallback logic would be extracted into a separate function, call it 'getch_or_getc' or 'console_getc' or similar. Bruno
