tcmd: fix closing fds[2] in cmd_pipe() - neatvi - [fork] simple vi-type editor with UTF-8 support
git clone git://src.adamsgaard.dk/neatvi
Log
Files
Refs
README
---
commit 7069bc1bd5c3c298b329b68f0a84f5b480b52896
parent 62df24f12c33e086991d6bee683289848f98daa7
Author: Ali Gholami Rudi 
Date:   Thu,  3 Sep 2020 16:01:38 +0430

cmd: fix closing fds[2] in cmd_pipe()

Diffstat:
  M cmd.c                               |       2 +-

1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/cmd.c b/cmd.c
t@@ -103,7 +103,7 @@ char *cmd_pipe(char *cmd, char *ibuf, int iproc, int oproc)
                         fds[0].fd = -1;
                 if (fds[1].revents & (POLLERR | POLLHUP | POLLNVAL))
                         fds[1].fd = -1;
-                if (fds[0].revents & (POLLERR | POLLHUP | POLLNVAL))
+                if (fds[2].revents & (POLLERR | POLLHUP | POLLNVAL))
                         fds[2].fd = -1;
         }
         close(ifd);