Karsten Hopp 54d6b1
To: vim_dev@googlegroups.com
Karsten Hopp 54d6b1
Subject: Patch 7.4.870
Karsten Hopp 54d6b1
Fcc: outbox
Karsten Hopp 54d6b1
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp 54d6b1
Mime-Version: 1.0
Karsten Hopp 54d6b1
Content-Type: text/plain; charset=UTF-8
Karsten Hopp 54d6b1
Content-Transfer-Encoding: 8bit
Karsten Hopp 54d6b1
------------
Karsten Hopp 54d6b1
Karsten Hopp 54d6b1
Patch 7.4.870
Karsten Hopp 54d6b1
Problem:    May get into an invalid state when using getchar() in an
Karsten Hopp 54d6b1
            expression mapping.
Karsten Hopp 54d6b1
Solution:   Anticipate mod_mask to change. (idea by Yukihiro Nakadaira)
Karsten Hopp 54d6b1
Files:      src/getchar.c
Karsten Hopp 54d6b1
Karsten Hopp 54d6b1
Karsten Hopp 54d6b1
*** ../vim-7.4.869/src/getchar.c	2015-09-15 14:12:01.378632565 +0200
Karsten Hopp 54d6b1
--- src/getchar.c	2015-09-15 18:17:50.192261837 +0200
Karsten Hopp 54d6b1
***************
Karsten Hopp 54d6b1
*** 1630,1642 ****
Karsten Hopp 54d6b1
        last_recorded_len = 0;
Karsten Hopp 54d6b1
        for (;;)			/* this is done twice if there are modifiers */
Karsten Hopp 54d6b1
        {
Karsten Hopp 54d6b1
  	if (mod_mask)		/* no mapping after modifier has been read */
Karsten Hopp 54d6b1
  	{
Karsten Hopp 54d6b1
  	    ++no_mapping;
Karsten Hopp 54d6b1
  	    ++allow_keys;
Karsten Hopp 54d6b1
  	}
Karsten Hopp 54d6b1
  	c = vgetorpeek(TRUE);
Karsten Hopp 54d6b1
! 	if (mod_mask)
Karsten Hopp 54d6b1
  	{
Karsten Hopp 54d6b1
  	    --no_mapping;
Karsten Hopp 54d6b1
  	    --allow_keys;
Karsten Hopp 54d6b1
--- 1630,1645 ----
Karsten Hopp 54d6b1
        last_recorded_len = 0;
Karsten Hopp 54d6b1
        for (;;)			/* this is done twice if there are modifiers */
Karsten Hopp 54d6b1
        {
Karsten Hopp 54d6b1
+ 	int did_inc = FALSE;
Karsten Hopp 54d6b1
+ 
Karsten Hopp 54d6b1
  	if (mod_mask)		/* no mapping after modifier has been read */
Karsten Hopp 54d6b1
  	{
Karsten Hopp 54d6b1
  	    ++no_mapping;
Karsten Hopp 54d6b1
  	    ++allow_keys;
Karsten Hopp 54d6b1
+ 	    did_inc = TRUE;	/* mod_mask may change value */
Karsten Hopp 54d6b1
  	}
Karsten Hopp 54d6b1
  	c = vgetorpeek(TRUE);
Karsten Hopp 54d6b1
! 	if (did_inc)
Karsten Hopp 54d6b1
  	{
Karsten Hopp 54d6b1
  	    --no_mapping;
Karsten Hopp 54d6b1
  	    --allow_keys;
Karsten Hopp 54d6b1
*** ../vim-7.4.869/src/version.c	2015-09-15 17:58:22.760394656 +0200
Karsten Hopp 54d6b1
--- src/version.c	2015-09-15 18:15:46.745544634 +0200
Karsten Hopp 54d6b1
***************
Karsten Hopp 54d6b1
*** 743,744 ****
Karsten Hopp 54d6b1
--- 743,746 ----
Karsten Hopp 54d6b1
  {   /* Add new patch number below this line */
Karsten Hopp 54d6b1
+ /**/
Karsten Hopp 54d6b1
+     870,
Karsten Hopp 54d6b1
  /**/
Karsten Hopp 54d6b1
Karsten Hopp 54d6b1
-- 
Karsten Hopp 54d6b1
I once paid $12 to peer at the box that held King Tutankhamen's little
Karsten Hopp 54d6b1
bandage-covered midget corpse at the De Young Museum in San Francisco.  I
Karsten Hopp 54d6b1
remember thinking how pleased he'd be about the way things turned out in his
Karsten Hopp 54d6b1
afterlife.
Karsten Hopp 54d6b1
				(Scott Adams - The Dilbert principle)
Karsten Hopp 54d6b1
Karsten Hopp 54d6b1
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp 54d6b1
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp 54d6b1
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
Karsten Hopp 54d6b1
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///