To: vim-dev@vim.org Subject: Patch 7.0.159 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit ------------ Patch 7.0.159 Problem: When there is an I/O error in the swap file the cause of the error cannot be seen. Solution: Use PERROR() instead of EMSG() where possible. Files: src/memfile.c *** ../vim-7.0.158/src/memfile.c Wed Nov 1 18:10:36 2006 --- src/memfile.c Wed Nov 1 21:38:59 2006 *************** *** 1028,1039 **** size = page_size * hp->bh_page_count; if (lseek(mfp->mf_fd, offset, SEEK_SET) != offset) { ! EMSG(_("E294: Seek error in swap file read")); return FAIL; } if ((unsigned)vim_read(mfp->mf_fd, hp->bh_data, size) != size) { ! EMSG(_("E295: Read error in swap file")); return FAIL; } return OK; --- 1028,1039 ---- size = page_size * hp->bh_page_count; if (lseek(mfp->mf_fd, offset, SEEK_SET) != offset) { ! PERROR(_("E294: Seek error in swap file read")); return FAIL; } if ((unsigned)vim_read(mfp->mf_fd, hp->bh_data, size) != size) { ! PERROR(_("E295: Read error in swap file")); return FAIL; } return OK; *************** *** 1085,1091 **** offset = (off_t)page_size * nr; if (lseek(mfp->mf_fd, offset, SEEK_SET) != offset) { ! EMSG(_("E296: Seek error in swap file write")); return FAIL; } if (hp2 == NULL) /* freed block, fill with dummy data */ --- 1085,1091 ---- offset = (off_t)page_size * nr; if (lseek(mfp->mf_fd, offset, SEEK_SET) != offset) { ! PERROR(_("E296: Seek error in swap file write")); return FAIL; } if (hp2 == NULL) /* freed block, fill with dummy data */ *** ../vim-7.0.158/src/version.c Wed Nov 1 21:24:58 2006 --- src/version.c Tue Nov 7 17:58:58 2006 *************** *** 668,669 **** --- 668,671 ---- { /* Add new patch number below this line */ + /**/ + 159, /**/ -- hundred-and-one symptoms of being an internet addict: 171. You invent another person and chat with yourself in empty chat rooms. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ download, build and distribute -- http://www.A-A-P.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///