summaryrefslogtreecommitdiff
path: root/src/os_mswin.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2017-03-18 16:18:37 +0100
committerBram Moolenaar <Bram@vim.org>2017-03-18 16:18:37 +0100
commit15bf76d40be1f1622ff5cc16596c308e76e2ca94 (patch)
treee3e19239a9369f65db8d135b3732ee28ae96cca7 /src/os_mswin.c
parent8c34aa09a449a5c1c2d1141b6fafa90f29b3fc12 (diff)
downloadvim-git-15bf76d40be1f1622ff5cc16596c308e76e2ca94.tar.gz
patch 8.0.0474: the client-server feature is not testedv8.0.0474
Problem: The client-server feature is not tested. Solution: Add a test.
Diffstat (limited to 'src/os_mswin.c')
-rw-r--r--src/os_mswin.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/os_mswin.c b/src/os_mswin.c
index a713ea190..166305298 100644
--- a/src/os_mswin.c
+++ b/src/os_mswin.c
@@ -2105,11 +2105,15 @@ Messaging_WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
str = serverConvert(client_enc, (char_u *)data->lpData, &tofree);
res = eval_client_expr_to_string(str);
- vim_free(tofree);
if (res == NULL)
{
- res = vim_strsave((char_u *)_(e_invexprmsg));
+ char *err = _(e_invexprmsg);
+ size_t len = STRLEN(str) + STRLEN(err) + 5;
+
+ res = alloc(len);
+ if (res != NULL)
+ vim_snprintf((char *)res, len, "%s: \"%s\"", err, str);
reply.dwData = COPYDATA_ERROR_RESULT;
}
else
@@ -2120,6 +2124,7 @@ Messaging_WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
serverSendEnc(sender);
retval = (int)SendMessage(sender, WM_COPYDATA,
(WPARAM)message_window, (LPARAM)(&reply));
+ vim_free(tofree);
vim_free(res);
return retval;