To: vim_dev@googlegroups.com Subject: Patch 7.4.1710 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 7.4.1710 Problem: Not all output of an external command is read. Solution: Avoid timing out when the process has exited. (closes #681) Files: src/os_unix.c *** ../vim-7.4.1709/src/os_unix.c 2016-03-28 19:16:15.669846492 +0200 --- src/os_unix.c 2016-04-03 15:46:27.407012997 +0200 *************** *** 4845,4850 **** --- 4845,4851 ---- break; # if defined(HAVE_GETTIMEOFDAY) && defined(HAVE_SYS_TIME_H) + if (wait_pid == 0) { struct timeval now_tv; long msec; *************** *** 4854,4860 **** * break out too often to avoid losing typeahead. */ gettimeofday(&now_tv, NULL); msec = (now_tv.tv_sec - start_tv.tv_sec) * 1000L ! + (now_tv.tv_usec - start_tv.tv_usec) / 1000L; if (msec > 2000) { noread_cnt = 5; --- 4855,4861 ---- * break out too often to avoid losing typeahead. */ gettimeofday(&now_tv, NULL); msec = (now_tv.tv_sec - start_tv.tv_sec) * 1000L ! + (now_tv.tv_usec - start_tv.tv_usec) / 1000L; if (msec > 2000) { noread_cnt = 5; *************** *** 4864,4873 **** # endif } ! /* If we already detected the child has finished break the ! * loop now. */ if (wait_pid == pid) break; /* * Check if the child still exists, before checking for --- 4865,4879 ---- # endif } ! /* If we already detected the child has finished, continue ! * reading output for a short while. Some text may be ! * buffered. */ if (wait_pid == pid) + { + if (noread_cnt < 5) + continue; break; + } /* * Check if the child still exists, before checking for *** ../vim-7.4.1709/src/version.c 2016-04-04 21:06:15.793741008 +0200 --- src/version.c 2016-04-04 22:02:25.691326851 +0200 *************** *** 750,751 **** --- 750,753 ---- { /* Add new patch number below this line */ + /**/ + 1710, /**/ -- If evolution theories are correct, humans will soon grow a third hand for operating the mouse. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///