fixup! mingw: Support git_terminal_prompt with more terminals

Also strip trailing CRLF instead of just LF or just CR.

Signed-off-by: Karsten Blees <blees@dcon.de>
This commit is contained in:
Karsten Blees
2015-05-07 14:12:22 +02:00
parent dac3c16ec9
commit 2b4d90fd47

View File

@@ -137,10 +137,8 @@ static char *xterm_prompt(const char *prompt, int echo)
goto ret;
}
if (len && buffer.buf[len - 1] == '\n')
strbuf_setlen(&buffer, len - 1);
if (len && buffer.buf[len - 1] == '\r')
strbuf_setlen(&buffer, len - 1);
strbuf_strip_suffix(&buffer, "\n");
strbuf_strip_suffix(&buffer, "\r");
ret:
if (!code)