• R/O
  • SSH

vim: Commit

Mirror of the Vim source from https://github.com/vim/vim


Commit MetaInfo

Revision3ff714d765bac9696552bbb9fc0ee47e3fd80440 (tree)
Zeit2020-04-07 05:15:39
AutorBram Moolenaar <Bram@vim....>
CommiterBram Moolenaar

Log Message

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)

Ändern Zusammenfassung

Diff

diff -r 005e707a7988 -r 3ff714d765ba src/buffer.c
--- a/src/buffer.c Mon Apr 06 21:45:32 2020 +0200
+++ b/src/buffer.c Mon Apr 06 22:15:39 2020 +0200
@@ -52,6 +52,9 @@
5252 # define dev_T unsigned
5353 #endif
5454
55+#define FOR_ALL_BUFS_FROM_LAST(buf) \
56+ for ((buf) = lastbuf; (buf) != NULL; (buf) = (buf)->b_prev)
57+
5558 #if defined(FEAT_QUICKFIX)
5659 static char *msg_loclist = N_("[Location List]");
5760 static char *msg_qflist = N_("[Quickfix List]");
@@ -415,7 +418,7 @@
415418
416419 // Assume that we more often have a recent buffer, start with the last
417420 // one.
418- for (bp = lastbuf; bp != NULL; bp = bp->b_prev)
421+ FOR_ALL_BUFS_FROM_LAST(bp)
419422 if (bp == buf)
420423 return TRUE;
421424 return FALSE;
@@ -2510,7 +2513,7 @@
25102513 buf_T *buf;
25112514
25122515 // Start at the last buffer, expect to find a match sooner.
2513- for (buf = lastbuf; buf != NULL; buf = buf->b_prev)
2516+ FOR_ALL_BUFS_FROM_LAST(buf)
25142517 if ((buf->b_flags & BF_DUMMY) == 0 && !otherfile_buf(buf, ffname
25152518 #ifdef UNIX
25162519 , stp
@@ -2593,7 +2596,7 @@
25932596 return -1;
25942597 }
25952598
2596- for (buf = lastbuf; buf != NULL; buf = buf->b_prev)
2599+ FOR_ALL_BUFS_FROM_LAST(buf)
25972600 if (buf->b_p_bl == find_listed
25982601 #ifdef FEAT_DIFF
25992602 && (!diffmode || diff_mode_buf(buf))
diff -r 005e707a7988 -r 3ff714d765ba src/drawscreen.c
--- a/src/drawscreen.c Mon Apr 06 21:45:32 2020 +0200
+++ b/src/drawscreen.c Mon Apr 06 22:15:39 2020 +0200
@@ -963,7 +963,7 @@
963963 int button_attr = syn_name2attr((char_u *)"ToolbarButton");
964964
965965 vim_free(wp->w_winbar_items);
966- for (menu = wp->w_winbar->children; menu != NULL; menu = menu->next)
966+ FOR_ALL_CHILD_MENUS(wp->w_winbar, menu)
967967 ++item_count;
968968 wp->w_winbar_items = ALLOC_CLEAR_MULT(winbar_item_T, item_count + 1);
969969
diff -r 005e707a7988 -r 3ff714d765ba src/evalfunc.c
--- a/src/evalfunc.c Mon Apr 06 21:45:32 2020 +0200
+++ b/src/evalfunc.c Mon Apr 06 22:15:39 2020 +0200
@@ -5008,7 +5008,7 @@
50085008
50095009 l = argvars[0].vval.v_list;
50105010 range_list_materialize(l);
5011- FOR_ALL_LIST_ITEMS(argvars[0].vval.v_list, li)
5011+ FOR_ALL_LIST_ITEMS(l, li)
50125012 {
50135013 msg_puts((char *)tv_get_string(&li->li_tv));
50145014 msg_putchar('\n');
@@ -7317,7 +7317,7 @@
73177317 if (ll != NULL)
73187318 {
73197319 range_list_materialize(ll);
7320- for (li = ll->lv_first; li != NULL; li = li->li_next)
7320+ FOR_ALL_LIST_ITEMS(ll, li)
73217321 {
73227322 strval = tv_get_string_buf_chk(&li->li_tv, buf);
73237323 if (strval == NULL)
diff -r 005e707a7988 -r 3ff714d765ba src/evalwindow.c
--- a/src/evalwindow.c Mon Apr 06 21:45:32 2020 +0200
+++ b/src/evalwindow.c Mon Apr 06 22:15:39 2020 +0200
@@ -444,8 +444,7 @@
444444 l = list_alloc();
445445 if (l != NULL)
446446 {
447- for (wp = (tp == curtab) ? firstwin : tp->tp_firstwin;
448- wp != NULL; wp = wp->w_next)
447+ FOR_ALL_WINDOWS_IN_TAB(tp, wp)
449448 list_append_number(l, (varnumber_T)wp->w_id);
450449 dict_add_list(dict, "windows", l);
451450 }
diff -r 005e707a7988 -r 3ff714d765ba src/globals.h
--- a/src/globals.h Mon Apr 06 21:45:32 2020 +0200
+++ b/src/globals.h Mon Apr 06 22:15:39 2020 +0200
@@ -574,6 +574,10 @@
574574 * overruling of menus that the user already defined.
575575 */
576576 EXTERN int sys_menu INIT(= FALSE);
577+
578+#define FOR_ALL_MENUS(m) for ((m) = root_menu; (m) != NULL; (m) = (m)->next)
579+#define FOR_ALL_CHILD_MENUS(p, c) \
580+ for ((c) = (p)->children; (c) != NULL; (c) = (c)->next)
577581 #endif
578582
579583 #ifdef FEAT_GUI
@@ -724,7 +728,8 @@
724728 EXTERN buf_T *lastbuf INIT(= NULL); // last buffer
725729 EXTERN buf_T *curbuf INIT(= NULL); // currently active buffer
726730
727-#define FOR_ALL_BUFFERS(buf) for (buf = firstbuf; buf != NULL; buf = buf->b_next)
731+#define FOR_ALL_BUFFERS(buf) \
732+ for ((buf) = firstbuf; (buf) != NULL; (buf) = (buf)->b_next)
728733
729734 #define FOR_ALL_BUF_WININFO(buf, wip) \
730735 for ((wip) = (buf)->b_wininfo; (wip) != NULL; (wip) = (wip)->wi_next)
@@ -1484,7 +1489,7 @@
14841489 EXTERN linenr_T spell_redraw_lnum INIT(= 0);
14851490
14861491 #define FOR_ALL_SPELL_LANGS(slang) \
1487- for ((slang) = first_lang; (slang) != NULL; (slang) = slang->sl_next)
1492+ for ((slang) = first_lang; (slang) != NULL; (slang) = (slang)->sl_next)
14881493 #endif
14891494
14901495 #ifdef FEAT_CONCEAL
@@ -1545,20 +1550,20 @@
15451550 EXTERN char e_fontwidth[] INIT(= N_("E236: Font \"%s\" is not fixed-width"));
15461551 #endif
15471552 EXTERN char e_internal[] INIT(= N_("E473: Internal error"));
1548-EXTERN char e_intern2[] INIT(= N_("E685: Internal error: %s"));
1549-EXTERN char e_interr[] INIT(= N_("Interrupted"));
1550-EXTERN char e_invarg[] INIT(= N_("E474: Invalid argument"));
1551-EXTERN char e_invarg2[] INIT(= N_("E475: Invalid argument: %s"));
1552-EXTERN char e_duparg2[] INIT(= N_("E983: Duplicate argument: %s"));
1553+EXTERN char e_intern2[] INIT(= N_("E685: Internal error: %s"));
1554+EXTERN char e_interr[] INIT(= N_("Interrupted"));
1555+EXTERN char e_invarg[] INIT(= N_("E474: Invalid argument"));
1556+EXTERN char e_invarg2[] INIT(= N_("E475: Invalid argument: %s"));
1557+EXTERN char e_duparg2[] INIT(= N_("E983: Duplicate argument: %s"));
15531558 EXTERN char e_invargval[] INIT(= N_("E475: Invalid value for argument %s"));
15541559 EXTERN char e_invargNval[] INIT(= N_("E475: Invalid value for argument %s: %s"));
15551560 #ifdef FEAT_EVAL
15561561 EXTERN char e_invexpr2[] INIT(= N_("E15: Invalid expression: %s"));
15571562 #endif
15581563 EXTERN char e_invrange[] INIT(= N_("E16: Invalid range"));
1559-EXTERN char e_invcmd[] INIT(= N_("E476: Invalid command"));
1564+EXTERN char e_invcmd[] INIT(= N_("E476: Invalid command"));
15601565 #if defined(UNIX) || defined(FEAT_SYN_HL) || defined(FEAT_SPELL)
1561-EXTERN char e_isadir2[] INIT(= N_("E17: \"%s\" is a directory"));
1566+EXTERN char e_isadir2[] INIT(= N_("E17: \"%s\" is a directory"));
15621567 #endif
15631568 #ifdef FEAT_LIBCALL
15641569 EXTERN char e_libcall[] INIT(= N_("E364: Library call failed for \"%s()\""));
@@ -1614,8 +1619,8 @@
16141619 #endif
16151620 EXTERN char e_notcreate[] INIT(= N_("E482: Can't create file %s"));
16161621 EXTERN char e_notmp[] INIT(= N_("E483: Can't get temp file name"));
1617-EXTERN char e_notopen[] INIT(= N_("E484: Can't open file %s"));
1618-EXTERN char e_notread[] INIT(= N_("E485: Can't read file %s"));
1622+EXTERN char e_notopen[] INIT(= N_("E484: Can't open file %s"));
1623+EXTERN char e_notread[] INIT(= N_("E485: Can't read file %s"));
16191624 EXTERN char e_null[] INIT(= N_("E38: Null argument"));
16201625 #if defined(FEAT_DIGRAPHS) || defined(FEAT_TIMERS) || defined(FEAT_EVAL)
16211626 EXTERN char e_number_exp[] INIT(= N_("E39: Number expected"));
@@ -1837,6 +1842,16 @@
18371842 EXTERN int did_repeated_msg INIT(= 0);
18381843 # define REPEATED_MSG_LOOKING 1
18391844 # define REPEATED_MSG_SAFESTATE 2
1845+
1846+#define FOR_ALL_CHANNELS(ch) \
1847+ for ((ch) = first_channel; (ch) != NULL; (ch) = (ch)->ch_next)
1848+#define FOR_ALL_JOBS(job) \
1849+ for ((job) = first_job; (job) != NULL; (job) = (job)->jv_next)
1850+#endif
1851+
1852+#if defined(FEAT_DIFF)
1853+#define FOR_ALL_DIFFBLOCKS_IN_TAB(tp, dp) \
1854+ for ((dp) = (tp)->tp_first_diff; (dp) != NULL; (dp) = (dp)->df_next)
18401855 #endif
18411856
18421857 #define FOR_ALL_LIST_ITEMS(l, li) \
diff -r 005e707a7988 -r 3ff714d765ba src/gui_athena.c
--- a/src/gui_athena.c Mon Apr 06 21:45:32 2020 +0200
+++ b/src/gui_athena.c Mon Apr 06 22:15:39 2020 +0200
@@ -954,7 +954,7 @@
954954 vimmenu_T *mp;
955955 int max_height = 9999;
956956
957- for (mp = root_menu; mp != NULL; mp = mp->next)
957+ FOR_ALL_MENUS(mp)
958958 {
959959 if (menu_is_menubar(mp->dname))
960960 {
@@ -1280,7 +1280,7 @@
12801280 vimmenu_T *toolbar;
12811281 vimmenu_T *cur;
12821282
1283- for (toolbar = root_menu; toolbar; toolbar = toolbar->next)
1283+ FOR_ALL_MENUS(toolbar)
12841284 if (menu_is_toolbar(toolbar->dname))
12851285 break;
12861286 // Assumption: toolbar is NULL if there is no toolbar,
@@ -1632,7 +1632,7 @@
16321632 {
16331633 vimmenu_T *i;
16341634
1635- for (i = menu->parent->children; i != NULL; i = i->next)
1635+ FOR_ALL_CHILD_MENUS(menu->parent, i)
16361636 {
16371637 if (i->submenu_id != NULL && XtIsManaged(i->submenu_id))
16381638 XtPopdown(i->submenu_id);
diff -r 005e707a7988 -r 3ff714d765ba src/gui_gtk.c
--- a/src/gui_gtk.c Mon Apr 06 21:45:32 2020 +0200
+++ b/src/gui_gtk.c Mon Apr 06 22:15:39 2020 +0200
@@ -824,7 +824,7 @@
824824 vimmenu_T *menu;
825825 char_u *name;
826826
827- for (menu = root_menu; menu != NULL; menu = menu->next)
827+ FOR_ALL_MENUS(menu)
828828 {
829829 if (menu->id == NULL)
830830 continue;
diff -r 005e707a7988 -r 3ff714d765ba src/gui_motif.c
--- a/src/gui_motif.c Mon Apr 06 21:45:32 2020 +0200
+++ b/src/gui_motif.c Mon Apr 06 22:15:39 2020 +0200
@@ -889,7 +889,7 @@
889889 {
890890 vimmenu_T *menu;
891891
892- for (menu = root_menu; menu != NULL; menu = menu->next)
892+ FOR_ALL_MENUS(menu)
893893 if (menu->id != (Widget)0)
894894 XtVaSetValues(menu->id,
895895 XmNmnemonic, enable ? menu->mnemonic : NUL,
@@ -1094,7 +1094,7 @@
10941094
10951095 // Find any menu Widget, to be able to call XtManageChild()
10961096 else
1097- for (mp = root_menu; mp != NULL; mp = mp->next)
1097+ FOR_ALL_MENUS(mp)
10981098 if (mp->id != (Widget)0 && menu_is_menubar(mp->name))
10991099 {
11001100 id = mp->id;
@@ -1112,7 +1112,7 @@
11121112 * Now find the menu item that is the furthest down, and get its position.
11131113 */
11141114 maxy = 0;
1115- for (mp = root_menu; mp != NULL; mp = mp->next)
1115+ FOR_ALL_MENUS(mp)
11161116 {
11171117 if (mp->id != (Widget)0 && menu_is_menubar(mp->name))
11181118 {
@@ -2928,7 +2928,7 @@
29282928 vimmenu_T *toolbar;
29292929 vimmenu_T *cur;
29302930
2931- for (toolbar = root_menu; toolbar; toolbar = toolbar->next)
2931+ FOR_ALL_MENUS(toolbar)
29322932 if (menu_is_toolbar(toolbar->dname))
29332933 break;
29342934 // Assumption: toolbar is NULL if there is no toolbar,
diff -r 005e707a7988 -r 3ff714d765ba src/gui_w32.c
--- a/src/gui_w32.c Mon Apr 06 21:45:32 2020 +0200
+++ b/src/gui_w32.c Mon Apr 06 22:15:39 2020 +0200
@@ -7591,7 +7591,7 @@
75917591 for (col = 0; col < 2; col++)
75927592 {
75937593 columnWidths[col] = 0;
7594- for (pmenu = menu->children; pmenu != NULL; pmenu = pmenu->next)
7594+ FOR_ALL_CHILD_MENUS(menu, pmenu)
75957595 {
75967596 // Use "dname" here to compute the width of the visible text.
75977597 text = (col == 0) ? pmenu->dname : pmenu->actext;
diff -r 005e707a7988 -r 3ff714d765ba src/list.c
--- a/src/list.c Mon Apr 06 21:45:32 2020 +0200
+++ b/src/list.c Mon Apr 06 22:15:39 2020 +0200
@@ -20,6 +20,9 @@
2020 // List heads for garbage collection.
2121 static list_T *first_list = NULL; // list of all lists
2222
23+#define FOR_ALL_WATCHERS(l, lw) \
24+ for ((lw) = (l)->lv_watch; (lw) != NULL; (lw) = (lw)->lw_next)
25+
2326 static void list_free_item(list_T *l, listitem_T *item);
2427
2528 /*
@@ -42,7 +45,7 @@
4245 listwatch_T *lw, **lwp;
4346
4447 lwp = &l->lv_watch;
45- for (lw = l->lv_watch; lw != NULL; lw = lw->lw_next)
48+ FOR_ALL_WATCHERS(l, lw)
4649 {
4750 if (lw == lwrem)
4851 {
@@ -62,7 +65,7 @@
6265 {
6366 listwatch_T *lw;
6467
65- for (lw = l->lv_watch; lw != NULL; lw = lw->lw_next)
68+ FOR_ALL_WATCHERS(l, lw)
6669 if (lw->lw_item == item)
6770 lw->lw_item = item->li_next;
6871 }
diff -r 005e707a7988 -r 3ff714d765ba src/menu.c
--- a/src/menu.c Mon Apr 06 21:45:32 2020 +0200
+++ b/src/menu.c Mon Apr 06 22:15:39 2020 +0200
@@ -1980,7 +1980,7 @@
19801980
19811981 apply_autocmds(EVENT_MENUPOPUP, (char_u*)mode, NULL, FALSE, curbuf);
19821982
1983- for (menu = root_menu; menu != NULL; menu = menu->next)
1983+ FOR_ALL_MENUS(menu)
19841984 if (STRNCMP("PopUp", menu->name, 5) == 0 && STRNCMP(menu->name + 5, mode, mode_len) == 0)
19851985 break;
19861986
@@ -2133,7 +2133,7 @@
21332133
21342134 if (key < 256)
21352135 key = TOLOWER_LOC(key);
2136- for (menu = root_menu; menu != NULL; menu = menu->next)
2136+ FOR_ALL_MENUS(menu)
21372137 if (menu->mnemonic == key
21382138 || (menu->mnemonic < 256 && TOLOWER_LOC(menu->mnemonic) == key))
21392139 return TRUE;
diff -r 005e707a7988 -r 3ff714d765ba src/popupmenu.c
--- a/src/popupmenu.c Mon Apr 06 21:45:32 2020 +0200
+++ b/src/popupmenu.c Mon Apr 06 22:15:39 2020 +0200
@@ -1379,7 +1379,7 @@
13791379 int idx = 0;
13801380 exarg_T ea;
13811381
1382- for (mp = menu->children; mp != NULL; mp = mp->next)
1382+ FOR_ALL_CHILD_MENUS(menu, mp)
13831383 if ((mp->modes & mp->enabled & mode) && idx++ == pum_selected)
13841384 {
13851385 vim_memset(&ea, 0, sizeof(ea));
@@ -1407,7 +1407,7 @@
14071407 pum_size = 0;
14081408 mode = get_menu_mode_flag();
14091409
1410- for (mp = menu->children; mp != NULL; mp = mp->next)
1410+ FOR_ALL_CHILD_MENUS(menu, mp)
14111411 if (menu_is_separator(mp->dname)
14121412 || (mp->modes & mp->enabled & mode))
14131413 ++pum_size;
@@ -1424,7 +1424,7 @@
14241424 if (array == NULL)
14251425 return;
14261426
1427- for (mp = menu->children; mp != NULL; mp = mp->next)
1427+ FOR_ALL_CHILD_MENUS(menu, mp)
14281428 if (menu_is_separator(mp->dname))
14291429 array[idx++].pum_text = (char_u *)"";
14301430 else if (mp->modes & mp->enabled & mode)
diff -r 005e707a7988 -r 3ff714d765ba src/popupwin.c
--- a/src/popupwin.c Mon Apr 06 21:45:32 2020 +0200
+++ b/src/popupwin.c Mon Apr 06 22:15:39 2020 +0200
@@ -2133,7 +2133,7 @@
21332133 // - another popup window with a terminal
21342134 // - the previous window
21352135 // - the first one.
2136- for (owp = first_popupwin; owp != NULL; owp = owp->w_next)
2136+ FOR_ALL_POPUPWINS(owp)
21372137 if (owp != curwin && owp->w_buffer->b_term != NULL)
21382138 break;
21392139 if (owp != NULL)
diff -r 005e707a7988 -r 3ff714d765ba src/quickfix.c
--- a/src/quickfix.c Mon Apr 06 21:45:32 2020 +0200
+++ b/src/quickfix.c Mon Apr 06 22:15:39 2020 +0200
@@ -6276,7 +6276,7 @@
62766276 win_T *wp;
62776277
62786278 if (firstwin->w_next != NULL)
6279- for (wp = firstwin; wp != NULL; wp = wp->w_next)
6279+ FOR_ALL_WINDOWS(wp)
62806280 if (wp->w_buffer == buf)
62816281 {
62826282 if (win_close(wp, FALSE) == OK)
diff -r 005e707a7988 -r 3ff714d765ba src/syntax.c
--- a/src/syntax.c Mon Apr 06 21:45:32 2020 +0200
+++ b/src/syntax.c Mon Apr 06 22:15:39 2020 +0200
@@ -256,6 +256,9 @@
256256 #define INVALID_STATE(ssp) ((ssp)->ga_itemsize == 0)
257257 #define VALID_STATE(ssp) ((ssp)->ga_itemsize != 0)
258258
259+#define FOR_ALL_SYNSTATES(sb, sst) \
260+ for ((sst) = (sb)->b_sst_first; (sst) != NULL; (sst) = (sst)->sst_next)
261+
259262 /*
260263 * The current state (within the line) of the recognition engine.
261264 * When current_state.ga_itemsize is 0 the current state is invalid.
@@ -438,7 +441,7 @@
438441 if (INVALID_STATE(&current_state) && syn_block->b_sst_array != NULL)
439442 {
440443 // Find last valid saved state before start_lnum.
441- for (p = syn_block->b_sst_first; p != NULL; p = p->sst_next)
444+ FOR_ALL_SYNSTATES(syn_block, p)
442445 {
443446 if (p->sst_lnum > lnum)
444447 break;
@@ -1044,7 +1047,7 @@
10441047
10451048 if (block->b_sst_array != NULL)
10461049 {
1047- for (p = block->b_sst_first; p != NULL; p = p->sst_next)
1050+ FOR_ALL_SYNSTATES(block, p)
10481051 clear_syn_state(p);
10491052 VIM_CLEAR(block->b_sst_array);
10501053 block->b_sst_first = NULL;
@@ -1353,7 +1356,7 @@
13531356 else
13541357 {
13551358 // find the entry just before this one to adjust sst_next
1356- for (p = syn_block->b_sst_first; p != NULL; p = p->sst_next)
1359+ FOR_ALL_SYNSTATES(syn_block, p)
13571360 if (p->sst_next == sp)
13581361 break;
13591362 if (p != NULL) // just in case
diff -r 005e707a7988 -r 3ff714d765ba src/time.c
--- a/src/time.c Mon Apr 06 21:45:32 2020 +0200
+++ b/src/time.c Mon Apr 06 22:15:39 2020 +0200
@@ -21,6 +21,9 @@
2121 static char tz_cache[64];
2222 #endif
2323
24+#define FOR_ALL_TIMERS(t) \
25+ for ((t) = first_timer; (t) != NULL; (t) = (t)->tr_next)
26+
2427 /*
2528 * Call either localtime(3) or localtime_r(3) from POSIX libc time.h, with the
2629 * latter version preferred for reentrancy.
@@ -583,7 +586,7 @@
583586
584587 if (id >= 0)
585588 {
586- for (timer = first_timer; timer != NULL; timer = timer->tr_next)
589+ FOR_ALL_TIMERS(timer)
587590 if (timer->tr_id == id)
588591 return timer;
589592 }
@@ -659,7 +662,7 @@
659662 {
660663 timer_T *timer;
661664
662- for (timer = first_timer; timer != NULL; timer = timer->tr_next)
665+ FOR_ALL_TIMERS(timer)
663666 if (timer->tr_id != -1)
664667 add_timer_info(rettv, timer);
665668 }
diff -r 005e707a7988 -r 3ff714d765ba src/userfunc.c
--- a/src/userfunc.c Mon Apr 06 21:45:32 2020 +0200
+++ b/src/userfunc.c Mon Apr 06 22:15:39 2020 +0200
@@ -1643,7 +1643,7 @@
16431643 int r = 0;
16441644
16451645 range_list_materialize(l);
1646- FOR_ALL_LIST_ITEMS(args->vval.v_list, item)
1646+ FOR_ALL_LIST_ITEMS(l, item)
16471647 {
16481648 if (argc == MAX_FUNC_ARGS - (partial == NULL ? 0 : partial->pt_argc))
16491649 {
diff -r 005e707a7988 -r 3ff714d765ba src/version.c
--- a/src/version.c Mon Apr 06 21:45:32 2020 +0200
+++ b/src/version.c Mon Apr 06 22:15:39 2020 +0200
@@ -739,6 +739,8 @@
739739 static int included_patches[] =
740740 { /* Add new patch number below this line */
741741 /**/
742+ 523,
743+/**/
742744 522,
743745 /**/
744746 521,
diff -r 005e707a7988 -r 3ff714d765ba src/vim9compile.c
--- a/src/vim9compile.c Mon Apr 06 21:45:32 2020 +0200
+++ b/src/vim9compile.c Mon Apr 06 22:15:39 2020 +0200
@@ -3984,7 +3984,7 @@
39843984 l = heredoc_get(eap, op + 3);
39853985
39863986 // Push each line and the create the list.
3987- for (li = l->lv_first; li != NULL; li = li->li_next)
3987+ FOR_ALL_LIST_ITEMS(l, li)
39883988 {
39893989 generate_PUSHS(cctx, li->li_tv.vval.v_string);
39903990 li->li_tv.vval.v_string = NULL;
Show on old repository browser