---
 st.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/st.c b/st.c
index 0204b2e..adf0b62 100644
--- a/st.c
+++ b/st.c
@@ -1298,8 +1298,7 @@ ttynew(void) {
        if (opt_line) {
                if((cmdfd = open(opt_line, O_RDWR)) < 0)
                        die("open line failed: %s\n", strerror(errno));
-               close(STDIN_FILENO);
-               dup(cmdfd);
+               dup2(cmdfd, STDIN_FILENO);
                stty();
                return;
        }
-- 
1.8.4


Reply via email to