To: vim-dev@vim.org Subject: Patch 6.1.400 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit ------------ Patch 6.1.400 (depends on 6.1.381) Problem: When a BufWriteCmd wipes out the buffer it may still be accessed. Solution: Don't try accessing a buffer that has been wiped out. Files: src/fileio.c *** ../vim61.399/src/fileio.c Sun Mar 9 15:48:31 2003 --- src/fileio.c Thu Mar 13 10:16:45 2003 *************** *** 2527,2538 **** * 1. the autocommands deleted or unloaded the buffer. * 2. If one of the "Cmd" autocommands was executed. */ ! if (!buf_valid(buf) || buf->b_ml.ml_mfp == NULL || did_cmd) { --no_wait_return; msg_scroll = msg_save; if (did_cmd) { if (overwriting) { /* Assume the buffer was written, update the timestamp. */ --- 2527,2544 ---- * 1. the autocommands deleted or unloaded the buffer. * 2. If one of the "Cmd" autocommands was executed. */ ! if (!buf_valid(buf)) ! buf = NULL; ! if (buf == NULL || buf->b_ml.ml_mfp == NULL || did_cmd) { --no_wait_return; msg_scroll = msg_save; if (did_cmd) { + if (buf == NULL) + /* The buffer was deleted. We assume it was written + * (can't retry anyway). */ + return OK; if (overwriting) { /* Assume the buffer was written, update the timestamp. */ *** ../vim61.399/src/version.c Sat Mar 15 16:36:06 2003 --- src/version.c Sat Mar 15 16:37:33 2003 *************** *** 613,614 **** --- 613,616 ---- { /* Add new patch number below this line */ + /**/ + 400, /**/ -- From "know your smileys": :~) A man with a tape recorder up his nose /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// Creator of Vim - Vi IMproved -- http://www.Vim.org \\\ \\\ Project leader for A-A-P -- http://www.A-A-P.org /// \\\ Help AIDS victims, buy at Amazon -- http://ICCF.nl/click1.html ///