]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.1.0579: Ex command is still executed after giving E1247 v9.1.0579
authorzeertzjq <zeertzjq@outlook.com>
Sat, 13 Jul 2024 17:04:10 +0000 (19:04 +0200)
committerChristian Brabandt <cb@256bit.org>
Sat, 13 Jul 2024 17:04:10 +0000 (19:04 +0200)
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>
src/ex_docmd.c
src/testdir/test_excmd.vim
src/version.c

index 614ba20805a80a8003a8978f2817eb7e9827107d..c90d64d7db149c9c4a5685c18b652ff4d0a44b4e 100644 (file)
@@ -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;
index 221ceb0f0bdb2d5fcefd5da1b309c30c1079de2d..3b7e489f38f03d1f2de83a92f92f127cf65c6833 100644 (file)
@@ -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
index c87d37891ec185182d31c0e1a2e3b0970c971e44..ac04272c6feb90ed75ebbebc55e9a07ee1c66048 100644 (file)
@@ -704,6 +704,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    579,
 /**/
     578,
 /**/