From ada492bcaa6b1dd7dd37405a7bd6786d258e7780 Mon Sep 17 00:00:00 2001 From: Christophe Varoqui Date: Fri, 11 Nov 2005 13:48:42 +0100 Subject: [PATCH] [multipathd] don't care interpreting "\n" as a cli command CR epileptics like me are happier now. multipathd> multipathd> multipathd> multipathd> multipathd> multipathd> multipathd> --- multipathd/uxclnt.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/multipathd/uxclnt.c b/multipathd/uxclnt.c index bb08a8a..47d528c 100644 --- a/multipathd/uxclnt.c +++ b/multipathd/uxclnt.c @@ -25,8 +25,14 @@ static void process(int fd) while ((line = readline("multipathd> "))) { size_t len; + size_t llen = strlen(line); - if (send_packet(fd, line, strlen(line) + 1) != 0) break; + if (!llen) { + free(line); + continue; + } + + if (send_packet(fd, line, llen + 1) != 0) break; if (recv_packet(fd, &reply, &len) != 0) break; printf("%s", reply); -- 2.7.4