diff src/os_mswin.c @ 11175:9836b701afd9 v8.0.0474

patch 8.0.0474: the client-server feature is not tested commit https://github.com/vim/vim/commit/15bf76d40be1f1622ff5cc16596c308e76e2ca94 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Mar 18 16:18:37 2017 +0100 patch 8.0.0474: the client-server feature is not tested Problem: The client-server feature is not tested. Solution: Add a test.
author Christian Brabandt <cb@256bit.org>
date Sat, 18 Mar 2017 16:30:04 +0100
parents 506f5d8b7d8b
children 76fb679a310e
line wrap: on
line diff
--- a/src/os_mswin.c
+++ b/src/os_mswin.c
@@ -2105,11 +2105,15 @@ Messaging_WndProc(HWND hwnd, UINT msg, W
 
 	    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, W
 	    serverSendEnc(sender);
 	    retval = (int)SendMessage(sender, WM_COPYDATA,
 				    (WPARAM)message_window, (LPARAM)(&reply));
+	    vim_free(tofree);
 	    vim_free(res);
 	    return retval;