Karsten Hopp 544cd3
To: vim-dev@vim.org
Karsten Hopp 544cd3
Subject: patch 7.1.043
Karsten Hopp 544cd3
Fcc: outbox
Karsten Hopp 544cd3
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp 544cd3
Mime-Version: 1.0
Karsten Hopp 544cd3
Content-Type: text/plain; charset=ISO-8859-1
Karsten Hopp 544cd3
Content-Transfer-Encoding: 8bit
Karsten Hopp 544cd3
------------
Karsten Hopp 544cd3
Karsten Hopp 544cd3
Patch 7.1.043
Karsten Hopp 544cd3
Problem:    In Ex mode using CTRL-D twice may cause a crash.  Cursor isn't
Karsten Hopp 544cd3
	    positioned properly after CTRL-D.
Karsten Hopp 544cd3
Solution:   Set prev_char properly.  Position the cursor correctly. (Antony
Karsten Hopp 544cd3
	    Scriven)
Karsten Hopp 544cd3
Files:	    src/ex_getln.c
Karsten Hopp 544cd3
Karsten Hopp 544cd3
Karsten Hopp 544cd3
*** ../vim-7.1.042/src/ex_getln.c	Tue Jul 24 14:32:44 2007
Karsten Hopp 544cd3
--- src/ex_getln.c	Wed Jul 25 20:57:05 2007
Karsten Hopp 544cd3
***************
Karsten Hopp 544cd3
*** 2095,2105 ****
Karsten Hopp 544cd3
      garray_T	line_ga;
Karsten Hopp 544cd3
      char_u	*pend;
Karsten Hopp 544cd3
      int		startcol = 0;
Karsten Hopp 544cd3
!     int		c1;
Karsten Hopp 544cd3
      int		escaped = FALSE;	/* CTRL-V typed */
Karsten Hopp 544cd3
      int		vcol = 0;
Karsten Hopp 544cd3
      char_u	*p;
Karsten Hopp 544cd3
!     int		prev_char = 0;
Karsten Hopp 544cd3
  
Karsten Hopp 544cd3
      /* Switch cursor on now.  This avoids that it happens after the "\n", which
Karsten Hopp 544cd3
       * confuses the system function that computes tabstops. */
Karsten Hopp 544cd3
--- 2095,2105 ----
Karsten Hopp 544cd3
      garray_T	line_ga;
Karsten Hopp 544cd3
      char_u	*pend;
Karsten Hopp 544cd3
      int		startcol = 0;
Karsten Hopp 544cd3
!     int		c1 = 0;
Karsten Hopp 544cd3
      int		escaped = FALSE;	/* CTRL-V typed */
Karsten Hopp 544cd3
      int		vcol = 0;
Karsten Hopp 544cd3
      char_u	*p;
Karsten Hopp 544cd3
!     int		prev_char;
Karsten Hopp 544cd3
  
Karsten Hopp 544cd3
      /* Switch cursor on now.  This avoids that it happens after the "\n", which
Karsten Hopp 544cd3
       * confuses the system function that computes tabstops. */
Karsten Hopp 544cd3
***************
Karsten Hopp 544cd3
*** 2152,2157 ****
Karsten Hopp 544cd3
--- 2152,2158 ----
Karsten Hopp 544cd3
  
Karsten Hopp 544cd3
  	/* Get one character at a time.  Don't use inchar(), it can't handle
Karsten Hopp 544cd3
  	 * special characters. */
Karsten Hopp 544cd3
+ 	prev_char = c1;
Karsten Hopp 544cd3
  	c1 = vgetc();
Karsten Hopp 544cd3
  
Karsten Hopp 544cd3
  	/*
Karsten Hopp 544cd3
***************
Karsten Hopp 544cd3
*** 2209,2215 ****
Karsten Hopp 544cd3
  redraw:
Karsten Hopp 544cd3
  		/* redraw the line */
Karsten Hopp 544cd3
  		msg_col = startcol;
Karsten Hopp 544cd3
- 		windgoto(msg_row, msg_col);
Karsten Hopp 544cd3
  		vcol = 0;
Karsten Hopp 544cd3
  		for (p = (char_u *)line_ga.ga_data;
Karsten Hopp 544cd3
  			  p < (char_u *)line_ga.ga_data + line_ga.ga_len; ++p)
Karsten Hopp 544cd3
--- 2210,2215 ----
Karsten Hopp 544cd3
***************
Karsten Hopp 544cd3
*** 2228,2233 ****
Karsten Hopp 544cd3
--- 2228,2234 ----
Karsten Hopp 544cd3
  		    }
Karsten Hopp 544cd3
  		}
Karsten Hopp 544cd3
  		msg_clr_eos();
Karsten Hopp 544cd3
+ 		windgoto(msg_row, msg_col);
Karsten Hopp 544cd3
  		continue;
Karsten Hopp 544cd3
  	    }
Karsten Hopp 544cd3
  
Karsten Hopp 544cd3
***************
Karsten Hopp 544cd3
*** 2273,2279 ****
Karsten Hopp 544cd3
  	if (IS_SPECIAL(c1))
Karsten Hopp 544cd3
  	    c1 = '?';
Karsten Hopp 544cd3
  	((char_u *)line_ga.ga_data)[line_ga.ga_len] = c1;
Karsten Hopp 544cd3
- 	prev_char = c1;
Karsten Hopp 544cd3
  	if (c1 == '\n')
Karsten Hopp 544cd3
  	    msg_putchar('\n');
Karsten Hopp 544cd3
  	else if (c1 == TAB)
Karsten Hopp 544cd3
--- 2274,2279 ----
Karsten Hopp 544cd3
*** ../vim-7.1.042/src/version.c	Fri Jul 27 21:32:13 2007
Karsten Hopp 544cd3
--- src/version.c	Sat Jul 28 14:19:37 2007
Karsten Hopp 544cd3
***************
Karsten Hopp 544cd3
*** 668,669 ****
Karsten Hopp 544cd3
--- 668,671 ----
Karsten Hopp 544cd3
  {   /* Add new patch number below this line */
Karsten Hopp 544cd3
+ /**/
Karsten Hopp 544cd3
+     43,
Karsten Hopp 544cd3
  /**/
Karsten Hopp 544cd3
Karsten Hopp 544cd3
-- 
Karsten Hopp 544cd3
hundred-and-one symptoms of being an internet addict:
Karsten Hopp 544cd3
48. You get a tatoo that says "This body best viewed with Netscape 3.1 or
Karsten Hopp 544cd3
    higher."
Karsten Hopp 544cd3
Karsten Hopp 544cd3
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp 544cd3
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp 544cd3
\\\        download, build and distribute -- http://www.A-A-P.org        ///
Karsten Hopp 544cd3
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///