Karsten Hopp 81c285
To: vim-dev@vim.org
Karsten Hopp 81c285
Subject: Patch 7.2.225
Karsten Hopp 81c285
Fcc: outbox
Karsten Hopp 81c285
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp 81c285
Mime-Version: 1.0
Karsten Hopp 81c285
Content-Type: text/plain; charset=UTF-8
Karsten Hopp 81c285
Content-Transfer-Encoding: 8bit
Karsten Hopp 81c285
------------
Karsten Hopp 81c285
Karsten Hopp 81c285
Patch 7.2.225
Karsten Hopp 81c285
Problem:    When using ":normal" a saved character may be executed.
Karsten Hopp 81c285
Solution:   Also store old_char when saving typeahead.
Karsten Hopp 81c285
Files:	    src/getchar.c, src/structs.h
Karsten Hopp 81c285
Karsten Hopp 81c285
Karsten Hopp 81c285
*** ../vim-7.2.224/src/getchar.c	2009-02-22 23:42:08.000000000 +0100
Karsten Hopp 81c285
--- src/getchar.c	2009-07-09 18:09:13.000000000 +0200
Karsten Hopp 81c285
***************
Karsten Hopp 81c285
*** 1309,1314 ****
Karsten Hopp 81c285
--- 1309,1317 ----
Karsten Hopp 81c285
      return OK;
Karsten Hopp 81c285
  }
Karsten Hopp 81c285
  
Karsten Hopp 81c285
+ static int old_char = -1;	/* character put back by vungetc() */
Karsten Hopp 81c285
+ static int old_mod_mask;	/* mod_mask for ungotten character */
Karsten Hopp 81c285
+ 
Karsten Hopp 81c285
  #if defined(FEAT_EVAL) || defined(FEAT_EX_EXTRA) || defined(PROTO)
Karsten Hopp 81c285
  
Karsten Hopp 81c285
  /*
Karsten Hopp 81c285
***************
Karsten Hopp 81c285
*** 1323,1328 ****
Karsten Hopp 81c285
--- 1326,1335 ----
Karsten Hopp 81c285
      if (!tp->typebuf_valid)
Karsten Hopp 81c285
  	typebuf = tp->save_typebuf;
Karsten Hopp 81c285
  
Karsten Hopp 81c285
+     tp->old_char = old_char;
Karsten Hopp 81c285
+     tp->old_mod_mask = old_mod_mask;
Karsten Hopp 81c285
+     old_char = -1;
Karsten Hopp 81c285
+ 
Karsten Hopp 81c285
      tp->save_stuffbuff = stuffbuff;
Karsten Hopp 81c285
      stuffbuff.bh_first.b_next = NULL;
Karsten Hopp 81c285
  # ifdef USE_INPUT_BUF
Karsten Hopp 81c285
***************
Karsten Hopp 81c285
*** 1344,1349 ****
Karsten Hopp 81c285
--- 1351,1359 ----
Karsten Hopp 81c285
  	typebuf = tp->save_typebuf;
Karsten Hopp 81c285
      }
Karsten Hopp 81c285
  
Karsten Hopp 81c285
+     old_char = tp->old_char;
Karsten Hopp 81c285
+     old_mod_mask = tp->old_mod_mask;
Karsten Hopp 81c285
+ 
Karsten Hopp 81c285
      free_buff(&stuffbuff);
Karsten Hopp 81c285
      stuffbuff = tp->save_stuffbuff;
Karsten Hopp 81c285
  # ifdef USE_INPUT_BUF
Karsten Hopp 81c285
***************
Karsten Hopp 81c285
*** 1499,1507 ****
Karsten Hopp 81c285
  #define KL_PART_KEY -1		/* keylen value for incomplete key-code */
Karsten Hopp 81c285
  #define KL_PART_MAP -2		/* keylen value for incomplete mapping */
Karsten Hopp 81c285
  
Karsten Hopp 81c285
- static int old_char = -1;	/* character put back by vungetc() */
Karsten Hopp 81c285
- static int old_mod_mask;	/* mod_mask for ungotten character */
Karsten Hopp 81c285
- 
Karsten Hopp 81c285
  /*
Karsten Hopp 81c285
   * Get the next input character.
Karsten Hopp 81c285
   * Can return a special key or a multi-byte character.
Karsten Hopp 81c285
--- 1509,1514 ----
Karsten Hopp 81c285
*** ../vim-7.2.224/src/structs.h	2009-06-16 16:01:34.000000000 +0200
Karsten Hopp 81c285
--- src/structs.h	2009-07-09 18:09:20.000000000 +0200
Karsten Hopp 81c285
***************
Karsten Hopp 81c285
*** 882,887 ****
Karsten Hopp 81c285
--- 882,889 ----
Karsten Hopp 81c285
  {
Karsten Hopp 81c285
      typebuf_T		save_typebuf;
Karsten Hopp 81c285
      int			typebuf_valid;	    /* TRUE when save_typebuf valid */
Karsten Hopp 81c285
+     int			old_char;
Karsten Hopp 81c285
+     int			old_mod_mask;
Karsten Hopp 81c285
      struct buffheader	save_stuffbuff;
Karsten Hopp 81c285
  #ifdef USE_INPUT_BUF
Karsten Hopp 81c285
      char_u		*save_inputbuf;
Karsten Hopp 81c285
*** ../vim-7.2.224/src/version.c	2009-07-09 18:15:19.000000000 +0200
Karsten Hopp 81c285
--- src/version.c	2009-07-09 18:21:56.000000000 +0200
Karsten Hopp 81c285
***************
Karsten Hopp 81c285
*** 678,679 ****
Karsten Hopp 81c285
--- 678,681 ----
Karsten Hopp 81c285
  {   /* Add new patch number below this line */
Karsten Hopp 81c285
+ /**/
Karsten Hopp 81c285
+     225,
Karsten Hopp 81c285
  /**/
Karsten Hopp 81c285
Karsten Hopp 81c285
-- 
Karsten Hopp 81c285
hundred-and-one symptoms of being an internet addict:
Karsten Hopp 81c285
78. You find yourself dialing IP numbers on the phone.
Karsten Hopp 81c285
Karsten Hopp 81c285
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp 81c285
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp 81c285
\\\        download, build and distribute -- http://www.A-A-P.org        ///
Karsten Hopp 81c285
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///