diff src/evalfunc.c @ 19934:3ff714d765ba v8.2.0523

patch 8.2.0523: loops are repeated Commit: https://github.com/vim/vim/commit/00d253e2b2f435a5386582c3f857008e7ac355c2 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Apr 6 22:13:01 2020 +0200 patch 8.2.0523: loops are repeated Problem: Loops are repeated. Solution: Use FOR_ALL_ macros. (Yegappan Lakshmanan, closes https://github.com/vim/vim/issues/5882)
author Bram Moolenaar <Bram@vim.org>
date Mon, 06 Apr 2020 22:15:39 +0200
parents 1f42c49c3d29
children 724417668d42
line wrap: on
line diff
--- a/src/evalfunc.c
+++ b/src/evalfunc.c
@@ -5008,7 +5008,7 @@ f_inputlist(typval_T *argvars, typval_T 
 
     l = argvars[0].vval.v_list;
     range_list_materialize(l);
-    FOR_ALL_LIST_ITEMS(argvars[0].vval.v_list, li)
+    FOR_ALL_LIST_ITEMS(l, li)
     {
 	msg_puts((char *)tv_get_string(&li->li_tv));
 	msg_putchar('\n');
@@ -7317,7 +7317,7 @@ f_setreg(typval_T *argvars, typval_T *re
 	if (ll != NULL)
 	{
 	    range_list_materialize(ll);
-	    for (li = ll->lv_first; li != NULL; li = li->li_next)
+	    FOR_ALL_LIST_ITEMS(ll, li)
 	    {
 		strval = tv_get_string_buf_chk(&li->li_tv, buf);
 		if (strval == NULL)