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.226 < prev    next >
Encoding:
Internet Message Format  |  2002-02-16  |  3.8 KB

  1. To: vim-dev@vim.org
  2. Subject: Patch 6.0.226
  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.226
  11. Problem:    When doing ":recover file" get the ATTENTION prompt.
  12.         After recovering the same file five times get a read error or a
  13.         crash.  (Alex Davis)
  14. Solution:   Set the recoverymode flag before setting the file name.
  15.         Correct the amount of used memory for the size of block zero.
  16. Files:        src/ex_docmd.c, src/memfile.c, src/memline.c,
  17.         src/proto/memfile.pro
  18.  
  19.  
  20. *** ../vim60.225/src/ex_docmd.c    Mon Feb  4 22:30:34 2002
  21. --- src/ex_docmd.c    Sun Feb 17 12:49:44 2002
  22. ***************
  23. *** 5474,5482 ****
  24. --- 5474,5485 ----
  25.   ex_recover(eap)
  26.       exarg_T    *eap;
  27.   {
  28. +     /* Set recoverymode right away to avoid the ATTENTION prompt. */
  29. +     recoverymode = TRUE;
  30.       if (!check_changed(curbuf, p_awa, TRUE, eap->forceit, FALSE)
  31.           && (*eap->arg == NUL || setfname(eap->arg, NULL, TRUE) == OK))
  32.       ml_recover();
  33. +     recoverymode = FALSE;
  34.   }
  35.   
  36.   /*
  37. *** ../vim60.225/src/memfile.c    Sun Sep  9 20:45:20 2001
  38. --- src/memfile.c    Sun Feb 17 13:46:35 2002
  39. ***************
  40. *** 301,306 ****
  41. --- 301,321 ----
  42.   }
  43.   
  44.   /*
  45. +  * Set new size for a memfile.  Used when block 0 of a swapfile has been read
  46. +  * and the size it indicates differs from what was guessed.
  47. +  */
  48. +     void
  49. + mf_new_page_size(mfp, new_size)
  50. +     memfile_T    *mfp;
  51. +     unsigned    new_size;
  52. + {
  53. +     /* Correct the memory used for block 0 to the new size, because it will be
  54. +      * freed with that size later on. */
  55. +     total_mem_used += new_size - mfp->mf_page_size;
  56. +     mfp->mf_page_size = new_size;
  57. + }
  58. + /*
  59.    * get a new block
  60.    *
  61.    *   negative: TRUE if negative block number desired (data block)
  62. *** ../vim60.225/src/memline.c    Sun Sep  9 18:12:48 2001
  63. --- src/memline.c    Sun Feb 17 13:45:43 2002
  64. ***************
  65. *** 881,887 ****
  66.        */
  67.       if (mfp->mf_page_size != (unsigned)char_to_long(b0p->b0_page_size))
  68.       {
  69. !     mfp->mf_page_size = (unsigned)char_to_long(b0p->b0_page_size);
  70.       if ((size = lseek(mfp->mf_fd, (off_t)0L, SEEK_END)) <= 0)
  71.           mfp->mf_blocknr_max = 0;        /* no file or empty file */
  72.       else
  73. --- 881,887 ----
  74.        */
  75.       if (mfp->mf_page_size != (unsigned)char_to_long(b0p->b0_page_size))
  76.       {
  77. !     mf_new_page_size(mfp, (unsigned)char_to_long(b0p->b0_page_size));
  78.       if ((size = lseek(mfp->mf_fd, (off_t)0L, SEEK_END)) <= 0)
  79.           mfp->mf_blocknr_max = 0;        /* no file or empty file */
  80.       else
  81. *** ../vim60.225/src/proto/memfile.pro    Tue Sep 25 21:49:18 2001
  82. --- src/proto/memfile.pro    Sun Feb 17 13:44:40 2002
  83. ***************
  84. *** 3,8 ****
  85. --- 3,9 ----
  86.   int mf_open_file __ARGS((memfile_T *mfp, char_u *fname));
  87.   void mf_close __ARGS((memfile_T *mfp, int del_file));
  88.   void mf_close_file __ARGS((buf_T *buf, int getlines));
  89. + void mf_new_page_size __ARGS((memfile_T *mfp, unsigned new_size));
  90.   bhdr_T *mf_new __ARGS((memfile_T *mfp, int negative, int page_count));
  91.   bhdr_T *mf_get __ARGS((memfile_T *mfp, blocknr_T nr, int page_count));
  92.   void mf_put __ARGS((memfile_T *mfp, bhdr_T *hp, int dirty, int infile));
  93. *** ../vim60.225/src/version.c    Sat Feb 16 22:55:56 2002
  94. --- src/version.c    Sun Feb 17 13:52:02 2002
  95. ***************
  96. *** 608,609 ****
  97. --- 608,611 ----
  98.   {   /* Add new patch number below this line */
  99. + /**/
  100. +     226,
  101.   /**/
  102.  
  103. -- 
  104.    Another bucket of what can only be described as human ordure hits ARTHUR.
  105. ARTHUR: ... Right!  (to the KNIGHTS) That settles it!
  106.                  "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
  107.  
  108.  ///  Bram Moolenaar -- Bram@moolenaar.net -- http://www.moolenaar.net  \\\
  109. ///   Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim   \\\
  110. \\\           Project leader for A-A-P -- http://www.a-a-p.org           ///
  111.  \\\  Help me helping AIDS orphans in Uganda - http://iccf-holland.org  ///
  112.