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: #15241
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
diff --git a/src/ex_docmd.c b/src/ex_docmd.c
index 614ba20..c90d64d 100644
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -4698,6 +4698,7 @@
if (n == MAXLNUM)
{
emsg(_(e_line_number_out_of_range));
+ cmd = NULL;
goto error;
}
}
@@ -4728,6 +4729,7 @@
if (lnum >= 0 && n >= LONG_MAX - lnum)
{
emsg(_(e_line_number_out_of_range));
+ cmd = NULL;
goto error;
}
lnum += n;