compat/terminal: support echoing on windows
commit431fa8f83c86b60ad13a972bd55bec1ec175699a
authorErik Faye-Lund <kusmabite@gmail.com>
Sun, 24 Jun 2012 13:23:19 +0000 (24 15:23 +0200)
committerPat Thoyts <patthoyts@users.sourceforge.net>
Mon, 1 Oct 2012 13:35:45 +0000 (1 14:35 +0100)
tree319199e87f4e07956ac2eb4461b8daaf9ac8de37
parent760e559f68e1c7b5b696db50e0e006240a7e2a8e
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