summaryrefslogtreecommitdiffstats
path: root/source/ap/vim/patches/7.3.594
blob: 3f7d3b261386d0563feee3e94081ad8d9b6d628f (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
161
162
163
164
165
166
167
168
169
170
171
To: vim_dev@googlegroups.com
Subject: Patch 7.3.594
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.3.594
Problem:    The X command server doesn't work perfectly. It sends an empty
	    reply for as-keys requests.
Solution:   Remove duplicate ga_init2(). Do not send a reply for as-keys
	    requests. (Brian Burns)
Files:	    src/if_xcmdsrv.c


*** ../vim-7.3.593/src/if_xcmdsrv.c	2010-08-15 21:57:27.000000000 +0200
--- src/if_xcmdsrv.c	2012-07-10 14:15:59.000000000 +0200
***************
*** 655,661 ****
  	if (SendInit(dpy) < 0)
  	    return NULL;
      }
-     ga_init2(&ga, 1, 100);
  
      /*
       * Read the registry property.
--- 655,660 ----
***************
*** 1198,1206 ****
  	if ((*p == 'c' || *p == 'k') && (p[1] == 0))
  	{
  	    Window	resWindow;
! 	    char_u	*name, *script, *serial, *end, *res;
  	    Bool	asKeys = *p == 'k';
- 	    garray_T	reply;
  	    char_u	*enc;
  
  	    /*
--- 1197,1204 ----
  	if ((*p == 'c' || *p == 'k') && (p[1] == 0))
  	{
  	    Window	resWindow;
! 	    char_u	*name, *script, *serial, *end;
  	    Bool	asKeys = *p == 'k';
  	    char_u	*enc;
  
  	    /*
***************
*** 1256,1305 ****
  	    if (script == NULL || name == NULL)
  		continue;
  
! 	    /*
! 	     * Initialize the result property, so that we're ready at any
! 	     * time if we need to return an error.
! 	     */
! 	    if (resWindow != None)
! 	    {
! 		ga_init2(&reply, 1, 100);
  #ifdef FEAT_MBYTE
! 		ga_grow(&reply, 50 + STRLEN(p_enc));
! 		sprintf(reply.ga_data, "%cr%c-E %s%c-s %s%c-r ",
  						   0, 0, p_enc, 0, serial, 0);
! 		reply.ga_len = 14 + STRLEN(p_enc) + STRLEN(serial);
  #else
! 		ga_grow(&reply, 50);
! 		sprintf(reply.ga_data, "%cr%c-s %s%c-r ", 0, 0, serial, 0);
! 		reply.ga_len = 10 + STRLEN(serial);
  #endif
! 	    }
! 	    res = NULL;
! 	    if (serverName != NULL && STRICMP(name, serverName) == 0)
! 	    {
! 		script = serverConvert(enc, script, &tofree);
! 		if (asKeys)
! 		    server_to_input_buf(script);
! 		else
! 		    res = eval_client_expr_to_string(script);
! 		vim_free(tofree);
! 	    }
! 	    if (resWindow != None)
! 	    {
! 		if (res != NULL)
! 		    ga_concat(&reply, res);
! 		else if (asKeys == 0)
! 		{
! 		    ga_concat(&reply, (char_u *)_(e_invexprmsg));
! 		    ga_append(&reply, 0);
! 		    ga_concat(&reply, (char_u *)"-c 1");
! 		}
! 		ga_append(&reply, NUL);
! 		(void)AppendPropCarefully(dpy, resWindow, commProperty,
! 					   reply.ga_data, reply.ga_len);
! 		ga_clear(&reply);
! 	    }
! 	    vim_free(res);
  	}
  	else if (*p == 'r' && p[1] == 0)
  	{
--- 1254,1305 ----
  	    if (script == NULL || name == NULL)
  		continue;
  
!             if (serverName != NULL && STRICMP(name, serverName) == 0)
!             {
!                 script = serverConvert(enc, script, &tofree);
!                 if (asKeys)
!                     server_to_input_buf(script);
!                 else
!                 {
!                     char_u      *res;
! 
!                     res = eval_client_expr_to_string(script);
! 		    if (resWindow != None)
! 		    {
! 			garray_T    reply;
! 
! 			/* Initialize the result property. */
! 			ga_init2(&reply, 1, 100);
  #ifdef FEAT_MBYTE
! 			ga_grow(&reply, 50 + STRLEN(p_enc));
! 			sprintf(reply.ga_data, "%cr%c-E %s%c-s %s%c-r ",
  						   0, 0, p_enc, 0, serial, 0);
! 			reply.ga_len = 14 + STRLEN(p_enc) + STRLEN(serial);
  #else
! 			ga_grow(&reply, 50);
! 			sprintf(reply.ga_data, "%cr%c-s %s%c-r ",
! 							     0, 0, serial, 0);
! 			reply.ga_len = 10 + STRLEN(serial);
  #endif
! 
! 			/* Evaluate the expression and return the result. */
! 			if (res != NULL)
! 			    ga_concat(&reply, res);
! 			else
! 			{
! 			    ga_concat(&reply, (char_u *)_(e_invexprmsg));
! 			    ga_append(&reply, 0);
! 			    ga_concat(&reply, (char_u *)"-c 1");
! 			}
! 			ga_append(&reply, NUL);
! 			(void)AppendPropCarefully(dpy, resWindow, commProperty,
! 						 reply.ga_data, reply.ga_len);
! 			ga_clear(&reply);
! 		    }
!                     vim_free(res);
!                 }
!                 vim_free(tofree);
!             }
  	}
  	else if (*p == 'r' && p[1] == 0)
  	{
*** ../vim-7.3.593/src/version.c	2012-07-10 13:41:09.000000000 +0200
--- src/version.c	2012-07-10 14:17:50.000000000 +0200
***************
*** 716,717 ****
--- 716,719 ----
  {   /* Add new patch number below this line */
+ /**/
+     594,
  /**/

-- 
A meeting is an event at which the minutes are kept and the hours are lost.

 /// 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    ///