mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-03-22 14:39:24 -05:00
log_proxy_stderr: cope with CRLF on proxy stderr lines.
The CR was getting as far as GTK, where it caused a formatting oddity in the Event Log list box. It should be stripped along with the LF.
This commit is contained in:
parent
9072bab11b
commit
55860cace7
@ -91,6 +91,8 @@ void log_proxy_stderr(Plug *plug, bufchain *buf, const void *vdata, int len)
|
|||||||
msg = snewn(msglen+1, char);
|
msg = snewn(msglen+1, char);
|
||||||
bufchain_fetch(buf, msg, msglen);
|
bufchain_fetch(buf, msg, msglen);
|
||||||
bufchain_consume(buf, msglen);
|
bufchain_consume(buf, msglen);
|
||||||
|
while (msglen > 0 && (msg[msglen-1] == '\n' || msg[msglen-1] == '\r'))
|
||||||
|
msglen--;
|
||||||
msg[msglen] = '\0';
|
msg[msglen] = '\0';
|
||||||
fullmsg = dupprintf("proxy: %s", msg);
|
fullmsg = dupprintf("proxy: %s", msg);
|
||||||
plug_log(plug, 2, NULL, 0, fullmsg, 0);
|
plug_log(plug, 2, NULL, 0, fullmsg, 0);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user