compat/terminal: support echoing on windows
authorErik Faye-Lund <kusmabite@gmail.com>
Sun, 24 Jun 2012 13:23:19 +0000 (15:23 +0200)
committerPat Thoyts <patthoyts@users.sourceforge.net>
Mon, 22 Oct 2012 12:31:42 +0000 (13:31 +0100)
commitcfe06a6f66c2bca038191ff407d0a42016a88e58
tree0841564578139901bb148f0205cded4309b15157
parent0ddd7a590cec086e1471f7693e80ab678b87cd13
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