compat/terminal: support echoing on windows
commit3006a55a0889cb1ea0f83b2e4e22ca32adc8bb12
authorErik Faye-Lund <kusmabite@gmail.com>
Sun, 24 Jun 2012 13:23:19 +0000 (24 15:23 +0200)
committerErik Faye-Lund <kusmabite@gmail.com>
Sun, 24 Jun 2012 15:34:56 +0000 (24 17:34 +0200)
tree53955a7bd2063e6016ca49311fc194253ab82e10
parent68b7ef2edd585f2aa8812f40c6f66825c92c5ce7
compat/terminal: support echoing on windows

Without /dev/tty support, git_terminal_prompt simply ignores the
'echo'-parameter. On Windows we can do better by clevering up our
getpass-implementation a bit so it can conditionally echo.

While we're at it, plug a small memory-leak by returning a pointer
to a static strbuf instead of detaching it. This is the same thing
the /dev/tty-version of git_terminal_prompt does, and the callee
doesn't expect to have to free it's memory.

Signed-off-by: Erik Faye-Lund <kusmabite@gmail.com>
compat/mingw.c
compat/mingw.h
compat/terminal.c