mirror of
https://github.com/vim/vim
synced 2025-07-16 01:01:58 +00:00
patch 8.2.2148: Vim9: crash when user command doesn't match
Problem: Vim9: crash when user command doesn't match. Solution: Adjust command index. (closes #7479)
This commit is contained in:
@ -3520,7 +3520,7 @@ find_ex_command(
|
||||
++p;
|
||||
p = find_ucmd(eap, p, full, NULL, NULL);
|
||||
}
|
||||
if (p == eap->cmd)
|
||||
if (p == NULL || p == eap->cmd)
|
||||
eap->cmdidx = CMD_SIZE;
|
||||
}
|
||||
|
||||
|
@ -701,5 +701,14 @@ def Test_cmd_argument_without_colon()
|
||||
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
|
||||
|
@ -750,6 +750,8 @@ static char *(features[]) =
|
||||
|
||||
static int included_patches[] =
|
||||
{ /* Add new patch number below this line */
|
||||
/**/
|
||||
2148,
|
||||
/**/
|
||||
2147,
|
||||
/**/
|
||||
|
Reference in New Issue
Block a user