1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-10 09:58:01 +00:00

Fix Plink's handling of interactor_announce() blank lines.

I'd forgotten that the text-only branch of seat_antispoof_msg()
constructs a string from its input in the expectation that it's a
one-line message. So it was a mistake to put a \n at the start of the
string in interactor_announce() to get a blank line first.

Now interactor_announce() makes an extra call to seat_antispoof_msg to
show its blank line, and seat_antispoof_msg itself handles the
blank-line case specially.
This commit is contained in:
Simon Tatham 2021-11-06 14:01:18 +00:00
parent 2ae338b407
commit 028714d02a
2 changed files with 2 additions and 2 deletions

View File

@ -97,7 +97,7 @@ InteractionReadySeat interactor_announce(Interactor *itr)
if (need_announcement) { if (need_announcement) {
const char *prefix = ""; const char *prefix = "";
if (itr_top->last_to_talk != NULL) if (itr_top->last_to_talk != NULL)
prefix = "\r\n"; seat_antispoof_msg(iseat, ""); /* leave a separating blank line */
char *desc = interactor_description(itr); char *desc = interactor_description(itr);
char *adjective = (level == 0 ? dupstr("primary") : char *adjective = (level == 0 ? dupstr("primary") :

View File

@ -12,7 +12,7 @@ void seat_antispoof_msg(InteractionReadySeat iseat, const char *msg)
* unmodified as an unspoofable header. * unmodified as an unspoofable header.
*/ */
put_datapl(sb, ptrlen_from_asciz(msg)); put_datapl(sb, ptrlen_from_asciz(msg));
} else { } else if (*msg) {
/* /*
* Otherwise, add enough padding around it that the server * Otherwise, add enough padding around it that the server
* wouldn't be able to mimic it within our line-length * wouldn't be able to mimic it within our line-length