summaryrefslogtreecommitdiffstats
path: root/patches/source/vim/patches/7.4.363
blob: d225cdb97de445e7ab066fd14ada990156259e93 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
To: vim_dev@googlegroups.com
Subject: Patch 7.4.363
Fcc: outbox
From: Bram Moolenaar <Bram@moolenaar.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
------------

Patch 7.4.363
Problem:    In Windows console typing 0xCE does not work.
Solution:   Convert 0xCE to K_NUL 3. (Nobuhiro Takasaki et al.)
Files:	    src/os_win32.c, src/term.c


*** ../vim-7.4.362/src/os_win32.c	2014-04-01 21:00:45.436733663 +0200
--- src/os_win32.c	2014-07-09 20:29:30.787609327 +0200
***************
*** 619,625 ****
  	return FALSE;
      }
  
!     tokenPrivileges.PrivilegeCount           = 1;
      tokenPrivileges.Privileges[0].Luid       = luid;
      tokenPrivileges.Privileges[0].Attributes = bEnable ?
  						    SE_PRIVILEGE_ENABLED : 0;
--- 619,625 ----
  	return FALSE;
      }
  
!     tokenPrivileges.PrivilegeCount	     = 1;
      tokenPrivileges.Privileges[0].Luid       = luid;
      tokenPrivileges.Privileges[0].Attributes = bEnable ?
  						    SE_PRIVILEGE_ENABLED : 0;
***************
*** 1785,1797 ****
  #endif
  	    {
  		int	n = 1;
  
- 		/* A key may have one or two bytes. */
  		typeahead[typeaheadlen] = c;
  		if (ch2 != NUL)
  		{
! 		    typeahead[typeaheadlen + 1] = ch2;
! 		    ++n;
  		}
  #ifdef FEAT_MBYTE
  		/* Only convert normal characters, not special keys.  Need to
--- 1785,1798 ----
  #endif
  	    {
  		int	n = 1;
+ 		int     conv = FALSE;
  
  		typeahead[typeaheadlen] = c;
  		if (ch2 != NUL)
  		{
! 		    typeahead[typeaheadlen + 1] = 3;
! 		    typeahead[typeaheadlen + 2] = ch2;
! 		    n += 2;
  		}
  #ifdef FEAT_MBYTE
  		/* Only convert normal characters, not special keys.  Need to
***************
*** 1800,1805 ****
--- 1801,1807 ----
  		if (input_conv.vc_type != CONV_NONE
  						&& (ch2 == NUL || c != K_NUL))
  		{
+ 		    conv = TRUE;
  		    typeaheadlen -= unconverted;
  		    n = convert_input_safe(typeahead + typeaheadlen,
  				n + unconverted, TYPEAHEADLEN - typeaheadlen,
***************
*** 1807,1812 ****
--- 1809,1832 ----
  		}
  #endif
  
+ 		if (conv)
+ 		{
+ 		    char_u *p = typeahead + typeaheadlen;
+ 		    char_u *e = typeahead + TYPEAHEADLEN;
+ 
+ 		    while (*p && p < e)
+ 		    {
+ 			if (*p == K_NUL)
+ 			{
+ 			    ++p;
+ 			    mch_memmove(p + 1, p, ((size_t)(e - p)) - 1);
+ 			    *p = 3;
+ 			    ++n;
+ 			}
+ 			++p;
+ 		    }
+ 		}
+ 
  		/* Use the ALT key to set the 8th bit of the character
  		 * when it's one byte, the 8th bit isn't set yet and not
  		 * using a double-byte encoding (would become a lead
*** ../vim-7.4.362/src/term.c	2014-07-09 19:13:45.003701718 +0200
--- src/term.c	2014-07-09 20:26:28.655613029 +0200
***************
*** 3724,3730 ****
--- 3724,3734 ----
  	return;
      }
  
+ #if defined(WIN3264) && !defined(FEAT_GUI)
+     s = vim_strnsave(string, (int)STRLEN(string) + 1);
+ #else
      s = vim_strsave(string);
+ #endif
      if (s == NULL)
  	return;
  
***************
*** 3734,3739 ****
--- 3738,3752 ----
  	STRMOVE(s, s + 1);
  	s[0] = term_7to8bit(string);
      }
+ 
+ #if defined(WIN3264) && !defined(FEAT_GUI)
+     if (s[0] == K_NUL)
+     {
+         STRMOVE(s + 1, s);
+         s[1] = 3;
+     }
+ #endif
+ 
      len = (int)STRLEN(s);
  
      need_gather = TRUE;		/* need to fill termleader[] */
*** ../vim-7.4.362/src/version.c	2014-07-09 20:20:40.359620108 +0200
--- src/version.c	2014-07-09 20:26:38.903612821 +0200
***************
*** 736,737 ****
--- 736,739 ----
  {   /* Add new patch number below this line */
+ /**/
+     363,
  /**/

-- 
BROTHER MAYNARD: Armaments Chapter Two Verses Nine to Twenty One.
ANOTHER MONK:    And St.  Attila raised his hand grenade up on high saying "O
                 Lord bless this thy hand grenade that with it thou mayest
                 blow thine enemies to tiny bits, in thy mercy. "and the Lord
                 did grin and people did feast upon the lambs and sloths and
                 carp and anchovies and orang-utans and breakfast cereals and
                 fruit bats and...
BROTHER MAYNARD: Skip a bit brother ...
                 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///