summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2024-07-13 19:04:10 +0200
committerChristian Brabandt <cb@256bit.org>2024-07-13 19:04:10 +0200
commitd1b5ea984d41102d253ecdd9a76124cd4c58b97d (patch)
treea5120625d52b230672dcfd802bbd946c8c99ecdd
parent360c51208eb36a527191cc5fe3f9c4f4cae1131a (diff)
patch 9.1.0579: Ex command is still executed after giving E1247v9.1.0579
Problem: Ex command is still executed after giving E1247. Solution: Indicate the error properly and set cmd to NULL. (zeertzjq) closes: #15241 Signed-off-by: zeertzjq <zeertzjq@outlook.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
-rw-r--r--src/ex_docmd.c2
-rw-r--r--src/testdir/test_excmd.vim2
-rw-r--r--src/version.c2
3 files changed, 6 insertions, 0 deletions
diff --git a/src/ex_docmd.c b/src/ex_docmd.c
index 614ba20805..c90d64d7db 100644
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -4698,6 +4698,7 @@ get_address(
if (n == MAXLNUM)
{
emsg(_(e_line_number_out_of_range));
+ cmd = NULL;
goto error;
}
}
@@ -4728,6 +4729,7 @@ get_address(
if (lnum >= 0 && n >= LONG_MAX - lnum)
{
emsg(_(e_line_number_out_of_range));
+ cmd = NULL;
goto error;
}
lnum += n;
diff --git a/src/testdir/test_excmd.vim b/src/testdir/test_excmd.vim
index 221ceb0f0b..3b7e489f38 100644
--- a/src/testdir/test_excmd.vim
+++ b/src/testdir/test_excmd.vim
@@ -703,6 +703,8 @@ func Test_address_line_overflow()
call setline(1, range(100))
call assert_fails('|.44444444444444444444444', 'E1247:')
call assert_fails('|.9223372036854775806', 'E1247:')
+ call assert_fails('.44444444444444444444444d', 'E1247:')
+ call assert_equal(range(100)->map('string(v:val)'), getline(1, '$'))
$
yank 77777777777777777777
diff --git a/src/version.c b/src/version.c
index c87d37891e..ac04272c6f 100644
--- a/src/version.c
+++ b/src/version.c
@@ -705,6 +705,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 579,
+/**/
578,
/**/
577,