Blame SOURCES/7.4.363

d6ba96
To: vim_dev@googlegroups.com
d6ba96
Subject: Patch 7.4.363
d6ba96
Fcc: outbox
d6ba96
From: Bram Moolenaar <Bram@moolenaar.net>
d6ba96
Mime-Version: 1.0
d6ba96
Content-Type: text/plain; charset=UTF-8
d6ba96
Content-Transfer-Encoding: 8bit
d6ba96
------------
d6ba96
d6ba96
Patch 7.4.363
d6ba96
Problem:    In Windows console typing 0xCE does not work.
d6ba96
Solution:   Convert 0xCE to K_NUL 3. (Nobuhiro Takasaki et al.)
d6ba96
Files:	    src/os_win32.c, src/term.c
d6ba96
d6ba96
d6ba96
*** ../vim-7.4.362/src/os_win32.c	2014-04-01 21:00:45.436733663 +0200
d6ba96
--- src/os_win32.c	2014-07-09 20:29:30.787609327 +0200
d6ba96
***************
d6ba96
*** 619,625 ****
d6ba96
  	return FALSE;
d6ba96
      }
d6ba96
  
d6ba96
!     tokenPrivileges.PrivilegeCount           = 1;
d6ba96
      tokenPrivileges.Privileges[0].Luid       = luid;
d6ba96
      tokenPrivileges.Privileges[0].Attributes = bEnable ?
d6ba96
  						    SE_PRIVILEGE_ENABLED : 0;
d6ba96
--- 619,625 ----
d6ba96
  	return FALSE;
d6ba96
      }
d6ba96
  
d6ba96
!     tokenPrivileges.PrivilegeCount	     = 1;
d6ba96
      tokenPrivileges.Privileges[0].Luid       = luid;
d6ba96
      tokenPrivileges.Privileges[0].Attributes = bEnable ?
d6ba96
  						    SE_PRIVILEGE_ENABLED : 0;
d6ba96
***************
d6ba96
*** 1785,1797 ****
d6ba96
  #endif
d6ba96
  	    {
d6ba96
  		int	n = 1;
d6ba96
  
d6ba96
- 		/* A key may have one or two bytes. */
d6ba96
  		typeahead[typeaheadlen] = c;
d6ba96
  		if (ch2 != NUL)
d6ba96
  		{
d6ba96
! 		    typeahead[typeaheadlen + 1] = ch2;
d6ba96
! 		    ++n;
d6ba96
  		}
d6ba96
  #ifdef FEAT_MBYTE
d6ba96
  		/* Only convert normal characters, not special keys.  Need to
d6ba96
--- 1785,1798 ----
d6ba96
  #endif
d6ba96
  	    {
d6ba96
  		int	n = 1;
d6ba96
+ 		int     conv = FALSE;
d6ba96
  
d6ba96
  		typeahead[typeaheadlen] = c;
d6ba96
  		if (ch2 != NUL)
d6ba96
  		{
d6ba96
! 		    typeahead[typeaheadlen + 1] = 3;
d6ba96
! 		    typeahead[typeaheadlen + 2] = ch2;
d6ba96
! 		    n += 2;
d6ba96
  		}
d6ba96
  #ifdef FEAT_MBYTE
d6ba96
  		/* Only convert normal characters, not special keys.  Need to
d6ba96
***************
d6ba96
*** 1800,1805 ****
d6ba96
--- 1801,1807 ----
d6ba96
  		if (input_conv.vc_type != CONV_NONE
d6ba96
  						&& (ch2 == NUL || c != K_NUL))
d6ba96
  		{
d6ba96
+ 		    conv = TRUE;
d6ba96
  		    typeaheadlen -= unconverted;
d6ba96
  		    n = convert_input_safe(typeahead + typeaheadlen,
d6ba96
  				n + unconverted, TYPEAHEADLEN - typeaheadlen,
d6ba96
***************
d6ba96
*** 1807,1812 ****
d6ba96
--- 1809,1832 ----
d6ba96
  		}
d6ba96
  #endif
d6ba96
  
d6ba96
+ 		if (conv)
d6ba96
+ 		{
d6ba96
+ 		    char_u *p = typeahead + typeaheadlen;
d6ba96
+ 		    char_u *e = typeahead + TYPEAHEADLEN;
d6ba96
+ 
d6ba96
+ 		    while (*p && p < e)
d6ba96
+ 		    {
d6ba96
+ 			if (*p == K_NUL)
d6ba96
+ 			{
d6ba96
+ 			    ++p;
d6ba96
+ 			    mch_memmove(p + 1, p, ((size_t)(e - p)) - 1);
d6ba96
+ 			    *p = 3;
d6ba96
+ 			    ++n;
d6ba96
+ 			}
d6ba96
+ 			++p;
d6ba96
+ 		    }
d6ba96
+ 		}
d6ba96
+ 
d6ba96
  		/* Use the ALT key to set the 8th bit of the character
d6ba96
  		 * when it's one byte, the 8th bit isn't set yet and not
d6ba96
  		 * using a double-byte encoding (would become a lead
d6ba96
*** ../vim-7.4.362/src/term.c	2014-07-09 19:13:45.003701718 +0200
d6ba96
--- src/term.c	2014-07-09 20:26:28.655613029 +0200
d6ba96
***************
d6ba96
*** 3724,3730 ****
d6ba96
--- 3724,3734 ----
d6ba96
  	return;
d6ba96
      }
d6ba96
  
d6ba96
+ #if defined(WIN3264) && !defined(FEAT_GUI)
d6ba96
+     s = vim_strnsave(string, (int)STRLEN(string) + 1);
d6ba96
+ #else
d6ba96
      s = vim_strsave(string);
d6ba96
+ #endif
d6ba96
      if (s == NULL)
d6ba96
  	return;
d6ba96
  
d6ba96
***************
d6ba96
*** 3734,3739 ****
d6ba96
--- 3738,3752 ----
d6ba96
  	STRMOVE(s, s + 1);
d6ba96
  	s[0] = term_7to8bit(string);
d6ba96
      }
d6ba96
+ 
d6ba96
+ #if defined(WIN3264) && !defined(FEAT_GUI)
d6ba96
+     if (s[0] == K_NUL)
d6ba96
+     {
d6ba96
+         STRMOVE(s + 1, s);
d6ba96
+         s[1] = 3;
d6ba96
+     }
d6ba96
+ #endif
d6ba96
+ 
d6ba96
      len = (int)STRLEN(s);
d6ba96
  
d6ba96
      need_gather = TRUE;		/* need to fill termleader[] */
d6ba96
*** ../vim-7.4.362/src/version.c	2014-07-09 20:20:40.359620108 +0200
d6ba96
--- src/version.c	2014-07-09 20:26:38.903612821 +0200
d6ba96
***************
d6ba96
*** 736,737 ****
d6ba96
--- 736,739 ----
d6ba96
  {   /* Add new patch number below this line */
d6ba96
+ /**/
d6ba96
+     363,
d6ba96
  /**/
d6ba96
d6ba96
-- 
d6ba96
BROTHER MAYNARD: Armaments Chapter Two Verses Nine to Twenty One.
d6ba96
ANOTHER MONK:    And St.  Attila raised his hand grenade up on high saying "O
d6ba96
                 Lord bless this thy hand grenade that with it thou mayest
d6ba96
                 blow thine enemies to tiny bits, in thy mercy. "and the Lord
d6ba96
                 did grin and people did feast upon the lambs and sloths and
d6ba96
                 carp and anchovies and orang-utans and breakfast cereals and
d6ba96
                 fruit bats and...
d6ba96
BROTHER MAYNARD: Skip a bit brother ...
d6ba96
                 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
d6ba96
d6ba96
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
d6ba96
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
d6ba96
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
d6ba96
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///