Patch 8.0.1485
Problem:    Weird autocmd may cause arglist to be changed recursively.
Solution:   Prevent recursively changing the argument list. (Christian
            Brabandt, closes #2472)
Files:      src/ex_docmd.c, src/globals.h


*** ../vim-8.0.1484/src/ex_docmd.c      2018-02-03 17:36:22.626091882 +0100
--- src/ex_docmd.c      2018-02-09 17:40:37.618711361 +0100
***************
*** 8058,8063 ****
--- 8058,8073 ----
      int               fnum_len)
  {
      int               i;
+     static int  recursive = 0;
+ 
+     if (recursive)
+     {
+ #ifdef FEAT_AUTOCMD
+       EMSG(_(e_au_recursive));
+ #endif
+       return;
+     }
+     ++recursive;
  
      alist_clear(al);
      if (ga_grow(&al->al_ga, count) == OK)
***************
*** 8087,8092 ****
--- 8097,8104 ----
        FreeWild(count, files);
      if (al == &global_alist)
        arg_had_last = FALSE;
+ 
+     --recursive;
  }
  
  /*
*** ../vim-8.0.1484/src/globals.h       2018-02-09 12:13:28.598612020 +0100
--- src/globals.h       2018-02-09 17:39:43.499037106 +0100
***************
*** 1594,1599 ****
--- 1594,1602 ----
  EXTERN char_u e_invalidreg[]    INIT(= N_("E850: Invalid register name"));
  #endif
  EXTERN char_u e_dirnotf[]     INIT(= N_("E919: Directory not found in '%s': 
\"%s\""));
+ #ifdef FEAT_AUTOCMD
+ EXTERN char_u e_au_recursive[]        INIT(= N_("E952: Autocommand caused 
recursive behavior"));
+ #endif
  
  #ifdef FEAT_GUI_MAC
  EXTERN short disallow_gui     INIT(= FALSE);
*** ../vim-8.0.1484/src/version.c       2018-02-09 16:45:56.045258620 +0100
--- src/version.c       2018-02-09 17:42:08.010157682 +0100
***************
*** 773,774 ****
--- 773,776 ----
  {   /* Add new patch number below this line */
+ /**/
+     1485,
  /**/

-- 
This is the polymorph virus!  Follow these instructions carefully:
1. Send this message to everybody you know.
2. Format your harddisk.
Thank you for your cooperation in spreading the most powerful virus ever!

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui