To: vim-dev@vim.org Subject: Patch 6.1.256 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit ------------ Patch 6.1.256 (depends on 6.1.255) Problem: Defining a function after ":if 0" could still cause an error message for an existing function. Leaking memory when there are trailing characters for ":delfunc". Solution: Check the "skip" flag. Free the memory. (Servatius Brandt) Files: src/eval.c *** ../vim61.255/src/eval.c Tue Nov 12 22:46:06 2002 --- src/eval.c Wed Nov 13 19:38:06 2002 *************** *** 7862,7868 **** /* Check if the function already exists, don't let the user type the * whole function before telling him it doesn't work! For a script we * need to skip the body to be able to find what follows. */ ! if (find_func(name) != NULL && !eap->forceit) { EMSG2(_(e_funcexts), name); goto erret; --- 7862,7868 ---- /* Check if the function already exists, don't let the user type the * whole function before telling him it doesn't work! For a script we * need to skip the body to be able to find what follows. */ ! if (!eap->skip && !eap->forceit && find_func(name) != NULL) { EMSG2(_(e_funcexts), name); goto erret; *************** *** 8246,8251 **** --- 8246,8252 ---- return; if (!ends_excmd(*skipwhite(p))) { + vim_free(name); EMSG(_(e_trailing)); return; } *** ../vim61.255/src/version.c Tue Nov 12 22:46:06 2002 --- src/version.c Tue Nov 19 11:13:05 2002 *************** *** 608,609 **** --- 608,611 ---- { /* Add new patch number below this line */ + /**/ + 256, /**/ -- hundred-and-one symptoms of being an internet addict: 83. Batteries in the TV remote now last for months. /// 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 /// \\\ Lord Of The Rings helps Uganda - http://iccf-holland.org/lotr.html ///