comparison src/eval.c @ 9062:0aa90b84118c v7.4.1816

commit https://github.com/vim/vim/commit/d8585eded6359f1d7e1981e96ae775efd077c638 Author: Bram Moolenaar <Bram@vim.org> Date: Sun May 1 23:05:53 2016 +0200 patch 7.4.1816 Problem: Looping over a null list throws an error. Solution: Skip over the for loop.
author Christian Brabandt <cb@256bit.org>
date Sun, 01 May 2016 23:15:05 +0200
parents 87c2e43a4a12
children ad9322b525e1
comparison
equal deleted inserted replaced
9061:37378cd98b84 9062:0aa90b84118c
3290 { 3290 {
3291 *errp = FALSE; 3291 *errp = FALSE;
3292 if (!skip) 3292 if (!skip)
3293 { 3293 {
3294 l = tv.vval.v_list; 3294 l = tv.vval.v_list;
3295 if (tv.v_type != VAR_LIST || l == NULL) 3295 if (tv.v_type != VAR_LIST)
3296 { 3296 {
3297 EMSG(_(e_listreq)); 3297 EMSG(_(e_listreq));
3298 clear_tv(&tv);
3299 }
3300 else if (l == NULL)
3301 {
3302 /* a null list is like an empty list: do nothing */
3298 clear_tv(&tv); 3303 clear_tv(&tv);
3299 } 3304 }
3300 else 3305 else
3301 { 3306 {
3302 /* No need to increment the refcount, it's already set for the 3307 /* No need to increment the refcount, it's already set for the