Re: [PATCH] compat: add a getpass() compatibility function

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Erik Faye-Lund <kusmabite@xxxxxxxxx> writes:

> Do we really need two implementations? Wouldn't it be better to factor
> out the mingw-version to a separate source file, and then improve it?

Thanks for reminding.

> Windows doesn't have /dev/tty, but the logic in this version handles
> that by using stdin/stderr instead. The signal-stuff has a comment
> that indicates it might not even be correct. tcgetattr/tcsetattr isn't
> supported on Windows, but it's not needed if we use getch (as the
> version in compat/mingw.c does). POSIX/curses getch respects the
> echo-setting, while Windows getch never echo.

I forgot to check how generic/reusable mingw version would look. As you
said, it does feel a lot more attractive approach if it is trivial to add
the "noecho" bit to it, tweak the tty-ness and deal with signals.

I however suspect the result would end up on the borderline to be called
"trivial", rough guestimate being 3-4 times as large as the 14-line mingw
version. But it certainly feels that it is worth a try.

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]