aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/eval.c
diff options
context:
space:
mode:
authorJames McCoy <jamessan@jamessan.com>2016-12-01 08:46:18 -0500
committerGitHub <noreply@github.com>2016-12-01 08:46:18 -0500
commit5194e3bc458eaa43871398bacea01e2d8b30b7e6 (patch)
treeb4181be3ea5e649906f9bbf7b998c23c50b9dceb /src/nvim/eval.c
parent1f8a3da796dd3418c5204c76192179dbdd6a5373 (diff)
parent8f84c1da83a2ef0912325f48b23637c706f3f2f0 (diff)
downloadrneovim-5194e3bc458eaa43871398bacea01e2d8b30b7e6.tar.gz
rneovim-5194e3bc458eaa43871398bacea01e2d8b30b7e6.tar.bz2
rneovim-5194e3bc458eaa43871398bacea01e2d8b30b7e6.zip
Merge pull request #5664 from brcolow/vim-7.4.1707
vim-patch:7.4.1707
Diffstat (limited to 'src/nvim/eval.c')
-rw-r--r--src/nvim/eval.c20
1 files changed, 7 insertions, 13 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c
index 422fedff1d..3e4f63884d 100644
--- a/src/nvim/eval.c
+++ b/src/nvim/eval.c
@@ -2160,11 +2160,9 @@ get_lval (
if (lp->ll_tv->v_type == VAR_DICT) {
if (len == -1) {
- /* "[key]": get key from "var1" */
- key = get_tv_string(&var1); /* is number or string */
- if (*key == NUL) {
- if (!quiet)
- EMSG(_(e_emptykey));
+ // "[key]": get key from "var1"
+ key = get_tv_string_chk(&var1); // is number or string
+ if (key == NULL) {
clear_tv(&var1);
return NULL;
}
@@ -4615,10 +4613,8 @@ eval_index (
dictitem_T *item;
if (len == -1) {
- key = get_tv_string(&var1);
- if (*key == NUL) {
- if (verbose)
- EMSG(_(e_emptykey));
+ key = get_tv_string_chk(&var1);
+ if (key == NULL) {
clear_tv(&var1);
return FAIL;
}
@@ -6602,10 +6598,8 @@ static int get_dict_tv(char_u **arg, typval_T *rettv, int evaluate)
}
if (evaluate) {
key = get_tv_string_buf_chk(&tvkey, buf);
- if (key == NULL || *key == NUL) {
- /* "key" is NULL when get_tv_string_buf_chk() gave an errmsg */
- if (key != NULL)
- EMSG(_(e_emptykey));
+ if (key == NULL) {
+ // "key" is NULL when get_tv_string_buf_chk() gave an errmsg
clear_tv(&tvkey);
goto failret;
}