To: vim_dev@googlegroups.com Subject: Patch 8.2.2148 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.2148 Problem: Vim9: crash when user command doesn't match. Solution: Adjust command index. (closes #7479) Files: src/ex_docmd.c, src/testdir/test_vim9_cmd.vim *** ../vim-8.2.2147/src/ex_docmd.c 2020-12-13 19:22:23.924419826 +0100 --- src/ex_docmd.c 2020-12-16 21:39:58.239901096 +0100 *************** *** 3520,3526 **** ++p; p = find_ucmd(eap, p, full, NULL, NULL); } ! if (p == eap->cmd) eap->cmdidx = CMD_SIZE; } --- 3520,3526 ---- ++p; p = find_ucmd(eap, p, full, NULL, NULL); } ! if (p == NULL || p == eap->cmd) eap->cmdidx = CMD_SIZE; } *** ../vim-8.2.2147/src/testdir/test_vim9_cmd.vim 2020-12-14 18:31:24.062840347 +0100 --- src/testdir/test_vim9_cmd.vim 2020-12-16 21:41:57.139527589 +0100 *************** *** 701,705 **** --- 701,714 ---- delete('Xfile') enddef + def Test_ambiguous_user_cmd() + var lines =<< trim END + com Cmd1 eval 0 + com Cmd2 eval 0 + Cmd + END + CheckScriptFailure(lines, 'E464:') + enddef + " vim: ts=8 sw=2 sts=2 expandtab tw=80 fdm=marker *** ../vim-8.2.2147/src/version.c 2020-12-16 21:02:51.642934141 +0100 --- src/version.c 2020-12-16 21:43:02.391322623 +0100 *************** *** 752,753 **** --- 752,755 ---- { /* Add new patch number below this line */ + /**/ + 2148, /**/ -- CART DRIVER: Bring out your dead! We follow the cart through a wretched, impoverished plague-ridden village. A few starved mongrels run about in the mud scavenging. In the open doorway of one house perhaps we jug glimpse a pair of legs dangling from the ceiling. In another doorway an OLD WOMAN is beating a cat against a wall rather like one does with a mat. The cart passes round a dead donkey or cow in the mud. And a MAN tied to a cart is being hammered to death by four NUNS with huge mallets. "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD /// 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 ///