diff options
author | lonerover <pathfinder1644@yahoo.com> | 2016-12-27 11:15:44 +0800 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2016-12-26 22:15:44 -0500 |
commit | a6b14dbb0be0145c2c347de65738042f27325519 (patch) | |
tree | 76be5aadd7f2a723e9f99624062aa7ed04bcc719 /src/nvim/eval.c | |
parent | 4431975210b58c6b0403ee50172bad3c8729bbb2 (diff) | |
download | rneovim-a6b14dbb0be0145c2c347de65738042f27325519.tar.gz rneovim-a6b14dbb0be0145c2c347de65738042f27325519.tar.bz2 rneovim-a6b14dbb0be0145c2c347de65738042f27325519.zip |
vim-patch:7.4.1816 (#5833)
Problem: Looping over a null list throws an error.
Solution: Skip over the for loop.
https://github.com/vim/vim/commit/d8585eded6359f1d7e1981e96ae775efd077c638
Diffstat (limited to 'src/nvim/eval.c')
-rw-r--r-- | src/nvim/eval.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c index 982074f62a..39e121eb53 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -2621,9 +2621,12 @@ void *eval_for_line(char_u *arg, int *errp, char_u **nextcmdp, int skip) *errp = FALSE; if (!skip) { l = tv.vval.v_list; - if (tv.v_type != VAR_LIST || l == NULL) { + if (tv.v_type != VAR_LIST) { EMSG(_(e_listreq)); clear_tv(&tv); + } else if (l == NULL) { + // a null list is like an empty list: do nothing + clear_tv(&tv); } else { /* No need to increment the refcount, it's already set for the * list being used in "tv". */ |