Karsten Hopp 710db5
To: vim-dev@vim.org
Karsten Hopp 710db5
Subject: Patch 7.2.359
Karsten Hopp 710db5
Fcc: outbox
Karsten Hopp 710db5
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp 710db5
Mime-Version: 1.0
Karsten Hopp 710db5
Content-Type: text/plain; charset=UTF-8
Karsten Hopp 710db5
Content-Transfer-Encoding: 8bit
Karsten Hopp 710db5
------------
Karsten Hopp 710db5
Karsten Hopp 710db5
Patch 7.2.359
Karsten Hopp 710db5
Problem:    Crash when using the Netbeans join command.
Karsten Hopp 710db5
Solution:   Make sure the ml_flush_line() function is not used recursively.
Karsten Hopp 710db5
	    (Xavier de Gaye)
Karsten Hopp 710db5
Files:	    src/memline.c
Karsten Hopp 710db5
Karsten Hopp 710db5
Karsten Hopp 710db5
*** ../vim-7.2.358/src/memline.c	2009-11-17 17:13:03.000000000 +0100
Karsten Hopp 710db5
--- src/memline.c	2010-02-11 18:47:48.000000000 +0100
Karsten Hopp 710db5
***************
Karsten Hopp 710db5
*** 3087,3098 ****
Karsten Hopp 710db5
--- 3087,3105 ----
Karsten Hopp 710db5
      int		start;
Karsten Hopp 710db5
      int		count;
Karsten Hopp 710db5
      int		i;
Karsten Hopp 710db5
+     static int  entered = FALSE;
Karsten Hopp 710db5
  
Karsten Hopp 710db5
      if (buf->b_ml.ml_line_lnum == 0 || buf->b_ml.ml_mfp == NULL)
Karsten Hopp 710db5
  	return;		/* nothing to do */
Karsten Hopp 710db5
  
Karsten Hopp 710db5
      if (buf->b_ml.ml_flags & ML_LINE_DIRTY)
Karsten Hopp 710db5
      {
Karsten Hopp 710db5
+ 	/* This code doesn't work recursively, but Netbeans may call back here
Karsten Hopp 710db5
+ 	 * when obtaining the cursor position. */
Karsten Hopp 710db5
+ 	if (entered)
Karsten Hopp 710db5
+ 	    return;
Karsten Hopp 710db5
+ 	entered = TRUE;
Karsten Hopp 710db5
+ 
Karsten Hopp 710db5
  	lnum = buf->b_ml.ml_line_lnum;
Karsten Hopp 710db5
  	new_line = buf->b_ml.ml_line_ptr;
Karsten Hopp 710db5
  
Karsten Hopp 710db5
***************
Karsten Hopp 710db5
*** 3160,3165 ****
Karsten Hopp 710db5
--- 3167,3174 ----
Karsten Hopp 710db5
  	    }
Karsten Hopp 710db5
  	}
Karsten Hopp 710db5
  	vim_free(new_line);
Karsten Hopp 710db5
+ 
Karsten Hopp 710db5
+ 	entered = FALSE;
Karsten Hopp 710db5
      }
Karsten Hopp 710db5
  
Karsten Hopp 710db5
      buf->b_ml.ml_line_lnum = 0;
Karsten Hopp 710db5
*** ../vim-7.2.358/src/version.c	2010-02-11 18:19:32.000000000 +0100
Karsten Hopp 710db5
--- src/version.c	2010-02-11 18:53:55.000000000 +0100
Karsten Hopp 710db5
***************
Karsten Hopp 710db5
*** 683,684 ****
Karsten Hopp 710db5
--- 683,686 ----
Karsten Hopp 710db5
  {   /* Add new patch number below this line */
Karsten Hopp 710db5
+ /**/
Karsten Hopp 710db5
+     359,
Karsten Hopp 710db5
  /**/
Karsten Hopp 710db5
Karsten Hopp 710db5
-- 
Karsten Hopp 710db5
Your fault: core dumped
Karsten Hopp 710db5
Karsten Hopp 710db5
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp 710db5
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp 710db5
\\\        download, build and distribute -- http://www.A-A-P.org        ///
Karsten Hopp 710db5
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///