patch 7.4.2362 v7.4.2362
authorBram Moolenaar <Bram@vim.org>
Sun, 11 Sep 2016 12:39:53 +0000 (14:39 +0200)
committerBram Moolenaar <Bram@vim.org>
Sun, 11 Sep 2016 12:39:53 +0000 (14:39 +0200)
Problem:    Illegal memory access with ":1@". (Dominique Pelle)
Solution:   Correct cursor column after setting the line number.  Also avoid
            calling end_visual_mode() when not in Visual mode.

src/buffer.c
src/ex_docmd.c
src/version.c

index 55e200ab889f8844b82083d86af662f2553e9408..b013295f731687ae80bb62abe812e695b4104824 100644 (file)
@@ -580,7 +580,7 @@ aucmd_abort:
 
     /* When closing the current buffer stop Visual mode before freeing
      * anything. */
-    if (buf == curbuf
+    if (buf == curbuf && VIsual_active
 #if defined(EXITFREE)
            && !entered_free_all_mem
 #endif
@@ -1389,7 +1389,7 @@ do_buffer(
        }
 
        /* When closing the current buffer stop Visual mode. */
-       if (buf == curbuf)
+       if (buf == curbuf && VIsual_active)
            end_visual_mode();
 
        /*
index dc0a71e682a8a6d117a2e1f6fa3d496bd3c72df0..eef559506d0dbe2acd88b856cae8f849a209b2de 100644 (file)
@@ -9388,6 +9388,7 @@ ex_at(exarg_T *eap)
     int                prev_len = typebuf.tb_len;
 
     curwin->w_cursor.lnum = eap->line2;
+    check_cursor_col();
 
 #ifdef USE_ON_FLY_SCROLL
     dont_scroll = TRUE;                /* disallow scrolling here */
index 9a6851e556312750ef8757aefe4c5c6f9797f1a1..8a6062d76e148d39e66f088d0754994244341f49 100644 (file)
@@ -763,6 +763,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2362,
 /**/
     2361,
 /**/