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