Blame SOURCES/7.4.363

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