From 3700d94c6fa3c6e2a58fc02414e4ca32b823214f Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sun, 14 Jul 2024 06:09:53 +0800 Subject: vim-patch:9.1.0579: Ex command is still executed after giving E1247 Problem: Ex command is still executed after giving E1247. Solution: Indicate the error properly and set cmd to NULL. (zeertzjq) closes: vim/vim#15241 https://github.com/vim/vim/commit/d1b5ea984d41102d253ecdd9a76124cd4c58b97d --- src/nvim/ex_docmd.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src') diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c index 63e7a80e53..44a9c07ec8 100644 --- a/src/nvim/ex_docmd.c +++ b/src/nvim/ex_docmd.c @@ -3619,6 +3619,7 @@ static linenr_T get_address(exarg_T *eap, char **ptr, cmd_addr_T addr_type, bool n = getdigits_int32(&cmd, false, MAXLNUM); if (n == MAXLNUM) { *errormsg = _(e_line_number_out_of_range); + cmd = NULL; goto error; } } @@ -3641,6 +3642,7 @@ static linenr_T get_address(exarg_T *eap, char **ptr, cmd_addr_T addr_type, bool } else { if (lnum >= 0 && n >= INT32_MAX - lnum) { *errormsg = _(e_line_number_out_of_range); + cmd = NULL; goto error; } lnum += n; -- cgit