To: vim_dev@googlegroups.com Subject: Patch 8.2.0189 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.0189 Problem: cd() with NULL argument crashes. Solution: Check for NULL. (Ken Takata, closes #5558) Files: src/testdir/test_cd.vim, src/ex_docmd.c *** ../vim-8.2.0188/src/testdir/test_cd.vim 2019-12-27 17:20:51.533918083 +0100 --- src/testdir/test_cd.vim 2020-01-31 22:37:06.286652204 +0100 *************** *** 101,106 **** --- 101,108 ---- call assert_fails("call chdir('dir-abcd')", 'E472:') silent! let d = chdir("dir_abcd") call assert_equal("", d) + " Should not crash + call chdir(d) only | tabonly call chdir(topdir) *** ../vim-8.2.0188/src/ex_docmd.c 2020-01-26 21:59:25.620718163 +0100 --- src/ex_docmd.c 2020-01-31 22:38:32.110161820 +0100 *************** *** 6572,6578 **** int dir_differs; int retval = FALSE; ! if (allbuf_locked()) return FALSE; if (vim_strchr(p_cpo, CPO_CHDIR) != NULL && curbufIsChanged() && !forceit) --- 6572,6578 ---- int dir_differs; int retval = FALSE; ! if (new_dir == NULL || allbuf_locked()) return FALSE; if (vim_strchr(p_cpo, CPO_CHDIR) != NULL && curbufIsChanged() && !forceit) *** ../vim-8.2.0188/src/version.c 2020-01-31 22:12:36.925061271 +0100 --- src/version.c 2020-01-31 22:38:04.306318159 +0100 *************** *** 744,745 **** --- 744,747 ---- { /* Add new patch number below this line */ + /**/ + 189, /**/ -- hundred-and-one symptoms of being an internet addict: 28. You have comandeered your teenager's phone line for the net and even his friends know not to call on his line anymore. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///