To: vim-dev@vim.org Subject: Patch 6.2f.022 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit ------------ Patch 6.2f.022 Problem: A bogus value for 'foldmarker' is not rejected, possibly causing a hang. (Derek Wyatt) Solution: Check for a non-empty string before and after the comma. Files: src/option.c *** ../vim-6.2f.021/src/option.c Mon May 26 22:15:06 2003 --- src/option.c Thu May 29 17:13:38 2003 *************** *** 5449,5456 **** /* 'foldmarker' */ else if (gvarp == &curwin->w_allbuf_opt.wo_fmr) { ! if (vim_strchr(*varp, ',') == NULL) errmsg = (char_u *)N_("E536: comma required"); else if (foldmethodIsMarker(curwin)) foldUpdateAll(curwin); } --- 5449,5459 ---- /* 'foldmarker' */ else if (gvarp == &curwin->w_allbuf_opt.wo_fmr) { ! p = vim_strchr(*varp, ','); ! if (p == NULL) errmsg = (char_u *)N_("E536: comma required"); + else if (p == *varp || p[1] == NUL) + errmsg = e_invarg; else if (foldmethodIsMarker(curwin)) foldUpdateAll(curwin); } *** ../vim-6.2f.021/src/version.c Thu May 29 16:11:03 2003 --- src/version.c Thu May 29 17:15:33 2003 *************** *** 632,633 **** --- 632,635 ---- { /* Add new patch number below this line */ + /**/ + 22, /**/ -- Bypasses are devices that allow some people to dash from point A to point B very fast while other people dash from point B to point A very fast. People living at point C, being a point directly in between, are often given to wonder what's so great about point A that so many people from point B are so keen to get there and what's so great about point B that so many people from point A are so keen to get there. They often wish that people would just once and for all work out where the hell they wanted to be. -- Douglas Adams, "The Hitchhiker's Guide to the Galaxy" /// 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 ///