To: vim-dev@vim.org Subject: Patch 6.0ax.001 Fcc: outbox From: Bram Moolenaar ------------ Patch 6.0ax.001 Problem: When 'patchmode' is set, appending to a file gives an empty original file. (Ed Ralston) Solution: Also make a backup copy when appending and 'patchmode' is set. Files: src/fileio.c *** ../vim60ax/src/fileio.c Tue Sep 18 14:37:30 2001 --- src/fileio.c Thu Sep 20 17:54:35 2001 *************** *** 2595,2608 **** /* * If we are not appending or filtering, the file exists, and the * 'writebackup', 'backup' or 'patchmode' option is set, need a backup. * * Do not make any backup, if 'writebackup' and 'backup' are both switched * off. This helps when editing large files on almost-full disks. */ ! if (!append && !filtering && perm >= 0 && dobackup) { ! if (*p_bkc == 'y') /* "yes" */ backup_copy = TRUE; #ifdef UNIX else if (*p_bkc == 'a') /* "auto" */ --- 2595,2609 ---- /* * If we are not appending or filtering, the file exists, and the * 'writebackup', 'backup' or 'patchmode' option is set, need a backup. + * When 'patchmode' is set also make a backup when appending. * * Do not make any backup, if 'writebackup' and 'backup' are both switched * off. This helps when editing large files on almost-full disks. */ ! if (!(append && *p_pm == NUL) && !filtering && perm >= 0 && dobackup) { ! if (*p_bkc == 'y' || append) /* "yes" */ backup_copy = TRUE; #ifdef UNIX else if (*p_bkc == 'a') /* "auto" */ *** ../vim60ax/src/version.c Mon Sep 10 11:43:25 2001 --- src/version.c Thu Sep 20 17:59:00 2001 *************** *** 608,609 **** --- 608,611 ---- { /* Add new patch number below this line */ + /**/ + 1, /**/ -- Be nice to your kids... they'll be the ones choosing your nursing home. /// Bram Moolenaar -- Bram@moolenaar.net -- http://www.moolenaar.net \\\ ((( Creator of Vim -- http://vim.sf.net -- ftp://ftp.vim.org/pub/vim ))) \\\ Help me helping AIDS orphans in Uganda - http://iccf-holland.org ///