To: vim_dev@googlegroups.com Subject: Patch 7.4.1235 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 7.4.1235 (after 7.4.1231) Problem: Missing change to eval.c. Solution: Include that change. Files: src/eval.c *** ../vim-7.4.1234/src/eval.c 2016-01-31 20:24:09.966066885 +0100 --- src/eval.c 2016-02-01 22:24:57.125706344 +0100 *************** *** 814,820 **** static int eval_isnamec1(int c); static int get_var_tv(char_u *name, int len, typval_T *rettv, dictitem_T **dip, int verbose, int no_autoload); static int handle_subscript(char_u **arg, typval_T *rettv, int evaluate, int verbose); - static typval_T *alloc_tv(void); static typval_T *alloc_string_tv(char_u *string); static void init_tv(typval_T *varp); static long get_tv_number(typval_T *varp); --- 814,819 ---- *************** *** 10065,10070 **** --- 10064,10072 ---- int port; int json_mode = FALSE; + /* default: fail */ + rettv->vval.v_number = -1; + address = get_tv_string(&argvars[0]); mode = get_tv_string_buf(&argvars[1], buf1); if (argvars[2].v_type != VAR_UNKNOWN) *************** *** 10366,10372 **** if (!channel_is_open(ch_idx)) { ! EMSGN(_("E999: not an open channel"), ch_idx); return -1; } return ch_idx; --- 10368,10374 ---- if (!channel_is_open(ch_idx)) { ! EMSGN(_("E906: not an open channel"), ch_idx); return -1; } return ch_idx; *************** *** 14100,14106 **** reader.js_buf = get_tv_string(&argvars[0]); reader.js_eof = TRUE; reader.js_used = 0; ! json_decode(&reader, rettv); } /* --- 14102,14109 ---- reader.js_buf = get_tv_string(&argvars[0]); reader.js_eof = TRUE; reader.js_used = 0; ! if (json_decode(&reader, rettv) == FAIL) ! EMSG(_(e_invarg)); } /* *************** *** 16896,16924 **** f_sendexpr(typval_T *argvars, typval_T *rettv) { char_u *text; ! char_u *resp; ! typval_T typetv; int ch_idx; /* return an empty string by default */ rettv->v_type = VAR_STRING; rettv->vval.v_string = NULL; ! text = json_encode_nr_expr(channel_get_id(), &argvars[1]); if (text == NULL) return; ch_idx = send_common(argvars, text, "sendexpr"); if (ch_idx >= 0) { ! /* TODO: read until the whole JSON message is received */ ! /* TODO: only use the message with the right message ID */ ! /* TODO: check sequence number */ ! resp = channel_read_block(ch_idx); ! if (resp != NULL) { ! channel_decode_json(resp, &typetv, rettv, NULL); ! vim_free(resp); } } } --- 16899,16935 ---- f_sendexpr(typval_T *argvars, typval_T *rettv) { char_u *text; ! typval_T *listtv; int ch_idx; + int id; /* return an empty string by default */ rettv->v_type = VAR_STRING; rettv->vval.v_string = NULL; ! id = channel_get_id(); ! text = json_encode_nr_expr(id, &argvars[1]); if (text == NULL) return; ch_idx = send_common(argvars, text, "sendexpr"); if (ch_idx >= 0) { ! if (channel_read_json_block(ch_idx, id, &listtv) == OK) { ! if (listtv->v_type == VAR_LIST) ! { ! list_T *list = listtv->vval.v_list; ! ! if (list->lv_len == 2) ! { ! /* Move the item from the list and then change the type to ! * avoid the value being freed. */ ! *rettv = list->lv_last->li_tv; ! list->lv_last->li_tv.v_type = VAR_NUMBER; ! } ! } ! clear_tv(listtv); } } } *************** *** 20923,20929 **** * Allocate memory for a variable type-value, and make it empty (0 or NULL * value). */ ! static typval_T * alloc_tv(void) { return (typval_T *)alloc_clear((unsigned)sizeof(typval_T)); --- 20934,20940 ---- * Allocate memory for a variable type-value, and make it empty (0 or NULL * value). */ ! typval_T * alloc_tv(void) { return (typval_T *)alloc_clear((unsigned)sizeof(typval_T)); *** ../vim-7.4.1234/src/version.c 2016-02-01 22:01:06.044672631 +0100 --- src/version.c 2016-02-01 22:39:30.016526652 +0100 *************** *** 744,745 **** --- 744,747 ---- { /* Add new patch number below this line */ + /**/ + 1235, /**/ -- hundred-and-one symptoms of being an internet addict: 97. Your mother tells you to remember something, and you look for a File/Save command. /// 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 ///