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 / 7.0 / 7.0.195 < prev    next >
Encoding:
Internet Message Format  |  2007-02-12  |  2.6 KB

  1. To: vim-dev@vim.org
  2. Subject: patch 7.0.195
  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 7.0.195
  11. Problem:    When a buffer is modified and 'autowriteall' is set, ":quit"
  12.             results in an endless loop when there is a conversion error while
  13.             writing. (Nikolai Weibull)
  14. Solution:   Make autowrite() return FAIL if the buffer is still changed after
  15.             writing it.
  16. Files:      src/ex_cmds2.c
  17.  
  18.  
  19. *** ../vim-7.0.194/src/ex_cmds2.c    Tue Jan 16 21:31:38 2007
  20. --- src/ex_cmds2.c    Tue Feb 13 06:11:28 2007
  21. ***************
  22. *** 1242,1255 ****
  23.       buf_T    *buf;
  24.       int        forceit;
  25.   {
  26.       if (!(p_aw || p_awa) || !p_write
  27.   #ifdef FEAT_QUICKFIX
  28. !     /* never autowrite a "nofile" or "nowrite" buffer */
  29. !     || bt_dontwrite(buf)
  30.   #endif
  31. !     || (!forceit && buf->b_p_ro) || buf->b_ffname == NULL)
  32.       return FAIL;
  33. !     return buf_write_all(buf, forceit);
  34.   }
  35.   
  36.   /*
  37. --- 1242,1263 ----
  38.       buf_T    *buf;
  39.       int        forceit;
  40.   {
  41. +     int        r;
  42.       if (!(p_aw || p_awa) || !p_write
  43.   #ifdef FEAT_QUICKFIX
  44. !         /* never autowrite a "nofile" or "nowrite" buffer */
  45. !         || bt_dontwrite(buf)
  46.   #endif
  47. !         || (!forceit && buf->b_p_ro) || buf->b_ffname == NULL)
  48.       return FAIL;
  49. !     r = buf_write_all(buf, forceit);
  50. !     /* Writing may succeed but the buffer still changed, e.g., when there is a
  51. !      * conversion error.  We do want to return FAIL then. */
  52. !     if (buf_valid(buf) && bufIsChanged(buf))
  53. !     r = FAIL;
  54. !     return r;
  55.   }
  56.   
  57.   /*
  58. ***************
  59. *** 1472,1477 ****
  60. --- 1480,1487 ----
  61.       if (buf == NULL)    /* No buffers changed */
  62.           return FALSE;
  63.   
  64. +     /* Try auto-writing the buffer.  If this fails but the buffer no
  65. +      * longer exists it's not changed, that's OK. */
  66.       if (check_changed(buf, p_awa, TRUE, FALSE, TRUE) && buf_valid(buf))
  67.           break;        /* didn't save - still changes */
  68.       }
  69. *** ../vim-7.0.194/src/version.c    Tue Feb 13 04:03:05 2007
  70. --- src/version.c    Tue Feb 13 06:18:28 2007
  71. ***************
  72. *** 668,669 ****
  73. --- 668,671 ----
  74.   {   /* Add new patch number below this line */
  75. + /**/
  76. +     195,
  77.   /**/
  78.  
  79. -- 
  80. hundred-and-one symptoms of being an internet addict:
  81. 115. You are late picking up your kid from school and try to explain
  82.      to the teacher you were stuck in Web traffic.
  83.  
  84.  /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
  85. ///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
  86. \\\        download, build and distribute -- http://www.A-A-P.org        ///
  87.  \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
  88.