home *** CD-ROM | disk | FTP | other *** search
/ vim.ftp.fu-berlin.de / 2015-02-03.vim.ftp.fu-berlin.de.tar / vim.ftp.fu-berlin.de / patches / 6.0.145 < prev    next >
Encoding:
Internet Message Format  |  2002-01-21  |  2.0 KB

  1. To: vim-dev@vim.org
  2. Subject: Patch 6.0.145
  3. Fcc: outbox
  4. From: Bram Moolenaar <Bram@moolenaar.net>
  5. MIME-Version: 1.0
  6. Content-Type: text/plain; charset=ISO-8859-1
  7. Content-Transfer-Encoding: 8bit
  8. ------------
  9.  
  10. Patch 6.0.145
  11. Problem:    When Vim can't read any input it might get stuck.  When
  12.         redirecting stdin and stderr Vim would not read commands from a
  13.         file.  (Servatius Brandt)
  14. Solution:   When repeatedly trying to read a character when it's not possible,
  15.         exit Vim.  When stdin and stderr are not a tty, still try reading
  16.         from them, but don't do a blocking wait.
  17. Files:        src/ui.c
  18.  
  19.  
  20. *** ../vim60.144/src/ui.c    Tue Jan 15 19:50:54 2002
  21. --- src/ui.c    Tue Jan 22 13:19:26 2002
  22. ***************
  23. *** 134,142 ****
  24.   
  25.   #ifdef NO_CONSOLE_INPUT
  26.       /* Don't wait for character input when the window hasn't been opened yet.
  27. !      * Must return something, otherwise we'll loop forever.  */
  28.       if (no_console_input())
  29.       {
  30.       buf[0] = CR;
  31.       return 1;
  32.       }
  33. --- 134,151 ----
  34.   
  35.   #ifdef NO_CONSOLE_INPUT
  36.       /* Don't wait for character input when the window hasn't been opened yet.
  37. !      * Do try reading, this works when redirecting stdin from a file.
  38. !      * Must return something, otherwise we'll loop forever.  If we run into
  39. !      * this very often we probably got stuck, exit Vim. */
  40.       if (no_console_input())
  41.       {
  42. +     static int count = 0;
  43. +     retval = mch_inchar(buf, maxlen, 10L);
  44. +     if (retval > 0)
  45. +         return retval;
  46. +     if (wtime == -1 && ++count == 1000)
  47. +         read_error_exit();
  48.       buf[0] = CR;
  49.       return 1;
  50.       }
  51. *** ../vim60.144/src/version.c    Mon Jan 21 12:52:54 2002
  52. --- src/version.c    Tue Jan 22 13:21:08 2002
  53. ***************
  54. *** 608,609 ****
  55. --- 608,611 ----
  56.   {   /* Add new patch number below this line */
  57. + /**/
  58. +     145,
  59.   /**/
  60.  
  61. --  
  62. Despite the cost of living, have you noticed how it remains so popular?
  63.  
  64.  ///  Bram Moolenaar -- Bram@moolenaar.net -- http://www.moolenaar.net  \\\
  65. (((   Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim   )))
  66.  \\\  Help me helping AIDS orphans in Uganda - http://iccf-holland.org  ///
  67.