To:
[email protected]
Subject: Patch 5.6a.19
Fcc: outbox
From: Bram Moolenaar <
[email protected]>
------------
Patch 5.6a.019
Problem: When trying to recover through NFS, which uses a large block size,
Vim might think the swap file is empty, because mf_blocknr_max is
zero. (Scott McDermott)
Solution: When computing the number of blocks of the file in mf_open(),
round up instead of down.
Files: src/memfile.c
*** ../vim-5.6a.18/src/memfile.c Mon Dec 20 09:59:15 1999
--- src/memfile.c Mon Jan 10 21:22:11 2000
***************
*** 185,191 ****
|| (size = lseek(mfp->mf_fd, (off_t)0L, SEEK_END)) <= 0)
mfp->mf_blocknr_max = 0; /* no file or empty file */
else
! mfp->mf_blocknr_max = (blocknr_t)(size / mfp->mf_page_size);
mfp->mf_blocknr_min = -1;
mfp->mf_neg_count = 0;
mfp->mf_infile_count = mfp->mf_blocknr_max;
--- 185,192 ----
|| (size = lseek(mfp->mf_fd, (off_t)0L, SEEK_END)) <= 0)
mfp->mf_blocknr_max = 0; /* no file or empty file */
else
! mfp->mf_blocknr_max = (blocknr_t)((size + mfp->mf_page_size - 1)
! / mfp->mf_page_size);
mfp->mf_blocknr_min = -1;
mfp->mf_neg_count = 0;
mfp->mf_infile_count = mfp->mf_blocknr_max;
*** ../vim-5.6a.18/src/version.c Sat Jan 8 23:13:04 2000
--- src/version.c Mon Jan 10 21:26:18 2000
***************
*** 420,421 ****
--- 420,423 ----
{ /* Add new patch number below this line */
+ /**/
+ 19,
/**/
--
hundred-and-one symptoms of being an internet addict:
97. Your mother tells you to remember something, and you look for
a File/Save command.
--/-/---- Bram Moolenaar ----
[email protected] ----
[email protected] ---\-\--
\ \ www.vim.org/iccf www.moolenaar.net www.vim.org / /