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.1.400 < prev    next >
Encoding:
Internet Message Format  |  2003-03-14  |  2.0 KB

  1. To: vim-dev@vim.org
  2. Subject: Patch 6.1.400
  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.1.400 (depends on 6.1.381)
  11. Problem:    When a BufWriteCmd wipes out the buffer it may still be accessed.
  12. Solution:   Don't try accessing a buffer that has been wiped out.
  13. Files:        src/fileio.c
  14.  
  15.  
  16. *** ../vim61.399/src/fileio.c    Sun Mar  9 15:48:31 2003
  17. --- src/fileio.c    Thu Mar 13 10:16:45 2003
  18. ***************
  19. *** 2527,2538 ****
  20.        * 1. the autocommands deleted or unloaded the buffer.
  21.        * 2. If one of the "Cmd" autocommands was executed.
  22.        */
  23. !     if (!buf_valid(buf) || buf->b_ml.ml_mfp == NULL || did_cmd)
  24.       {
  25.           --no_wait_return;
  26.           msg_scroll = msg_save;
  27.           if (did_cmd)
  28.           {
  29.           if (overwriting)
  30.           {
  31.               /* Assume the buffer was written, update the timestamp. */
  32. --- 2527,2544 ----
  33.        * 1. the autocommands deleted or unloaded the buffer.
  34.        * 2. If one of the "Cmd" autocommands was executed.
  35.        */
  36. !     if (!buf_valid(buf))
  37. !         buf = NULL;
  38. !     if (buf == NULL || buf->b_ml.ml_mfp == NULL || did_cmd)
  39.       {
  40.           --no_wait_return;
  41.           msg_scroll = msg_save;
  42.           if (did_cmd)
  43.           {
  44. +         if (buf == NULL)
  45. +             /* The buffer was deleted.  We assume it was written
  46. +              * (can't retry anyway). */
  47. +             return OK;
  48.           if (overwriting)
  49.           {
  50.               /* Assume the buffer was written, update the timestamp. */
  51. *** ../vim61.399/src/version.c    Sat Mar 15 16:36:06 2003
  52. --- src/version.c    Sat Mar 15 16:37:33 2003
  53. ***************
  54. *** 613,614 ****
  55. --- 613,616 ----
  56.   {   /* Add new patch number below this line */
  57. + /**/
  58. +     400,
  59.   /**/
  60.  
  61. -- 
  62. From "know your smileys":
  63.  :~)    A man with a tape recorder up his nose
  64.  
  65.  /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
  66. ///          Creator of Vim - Vi IMproved -- http://www.Vim.org          \\\
  67. \\\              Project leader for A-A-P -- http://www.A-A-P.org        ///
  68.  \\\     Help AIDS victims, buy at Amazon -- http://ICCF.nl/click1.html ///
  69.