From: Jouni Malinen Date: Mon, 21 Feb 2011 20:50:11 +0000 (+0200) Subject: wpa_cli: Add newline to end of responses in interactive mode X-Git-Tag: hostap-1-bp~574 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a432bafbca5bd6c0e7a5de886596187b5e30b546;p=thirdparty%2Fhostap.git wpa_cli: Add newline to end of responses in interactive mode Some of the wpa_supplicant control interface commands, like WPS_PIN, may not include a newline in the end of the response. This can result in the response being lost when wpa_cli redraws the screen after an event message. Add a newline after such responses in interactive mode to avoid the problem. --- diff --git a/wpa_supplicant/wpa_cli.c b/wpa_supplicant/wpa_cli.c index c511cc064..b59ed1f1b 100644 --- a/wpa_supplicant/wpa_cli.c +++ b/wpa_supplicant/wpa_cli.c @@ -254,6 +254,8 @@ static int _wpa_ctrl_command(struct wpa_ctrl *ctrl, char *cmd, int print) if (print) { buf[len] = '\0'; printf("%s", buf); + if (interactive && len > 0 && buf[len - 1] != '\n') + printf("\n"); } return 0; }