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 / old / 5.6.092 < prev    next >
Encoding:
Internet Message Format  |  2000-06-05  |  2.3 KB

  1. To: vim-dev@vim.org
  2. Subject: Patch 5.6.092
  3. Fcc: outbox
  4. From: Bram Moolenaar <Bram@moolenaar.net>
  5. ------------
  6.  
  7. Patch 5.6.092
  8. Problem:    FreeBSD: When setting $TERM to a non-valid terminal name, Vim
  9.             hangs in tputs().
  10. Solution:   After tgetent() returns an error code, call it again with the 
  11.             terminal name "dumb".  This apparently creates an environment in 
  12.             which tputs() doesn't fail.
  13. Files:      src/term.c
  14.  
  15.  
  16. *** ../vim-5.6.91/src/term.c    Wed Apr 12 20:42:06 2000
  17. --- src/term.c    Tue Jun  6 15:33:43 2000
  18. ***************
  19. *** 1931,1944 ****
  20.       int        i;
  21.   
  22.       i = TGETENT(tbuf, term);
  23. !     if (i == -1)
  24. !     return (char_u *)"Cannot open termcap file";
  25. !     if (i == 0)
  26.   #ifdef TERMINFO
  27. !     return (char_u *)"Terminal entry not found in terminfo";
  28.   #else
  29. !     return (char_u *)"Terminal entry not found in termcap";
  30.   #endif
  31.       return NULL;
  32.   }
  33.   
  34. --- 1931,1952 ----
  35.       int        i;
  36.   
  37.       i = TGETENT(tbuf, term);
  38. !     if (i < 1)
  39. !     {
  40. !     /* On FreeBSD tputs() gets a SEGV after a tgetent() which fails.  Call
  41. !      * tgetent() with the always existing "dumb" entry to avoid a crash or
  42. !      * hang. */
  43. !     (void)TGETENT(tbuf, "dumb");
  44. !     if (i == -1)
  45. !         return (char_u *)"Cannot open termcap file";
  46. !     if (i == 0)
  47.   #ifdef TERMINFO
  48. !         return (char_u *)"Terminal entry not found in terminfo";
  49.   #else
  50. !         return (char_u *)"Terminal entry not found in termcap";
  51.   #endif
  52. +     }
  53.       return NULL;
  54.   }
  55.   
  56. ***************
  57. *** 1972,1978 ****
  58.   {
  59.       char_u        tbuf[TBUFSZ];
  60.   
  61. !     if (T_NAME != NULL && *T_NAME != NUL && TGETENT(tbuf, T_NAME) > 0)
  62.       {
  63.       if (Columns == 0)
  64.           Columns = tgetnum("co");
  65. --- 1980,1986 ----
  66.   {
  67.       char_u        tbuf[TBUFSZ];
  68.   
  69. !     if (T_NAME != NULL && *T_NAME != NUL && tgetent_error(tbuf, T_NAME) == NULL)
  70.       {
  71.       if (Columns == 0)
  72.           Columns = tgetnum("co");
  73. *** ../vim-5.6.91/src/version.c    Tue Jun  6 14:13:00 2000
  74. --- src/version.c    Tue Jun  6 15:25:21 2000
  75. ***************
  76. *** 420,421 ****
  77. --- 420,423 ----
  78.   {   /* Add new patch number below this line */
  79. + /**/
  80. +     92,
  81.   /**/
  82.  
  83. -- 
  84. BLACK KNIGHT: I'm invincible!
  85. ARTHUR:       You're a looney.
  86.                  "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
  87.  
  88. /-/-- Bram Moolenaar --- Bram@moolenaar.net --- http://www.moolenaar.net --\-\
  89. \-\-- Vim: http://www.vim.org ---- ICCF Holland: http://www.vim.org/iccf --/-/
  90.