vis

a vi-like editor based on Plan 9's structural regular expressions

git clone https://9o.is/git/vis.git

commit 18c7be777d15f17f8709b1ab6c6dd5767de5c4e4
parent c29991e1a1737518a14158f9172bde7304a82525
Author: Marc André Tanner <mat@brain-dump.org>
Date:   Thu, 22 Dec 2016 09:12:56 +0100

text: avoid undefined multiple accesses in expression

Work around for a (bogus?) tis-interpreter warning.

Diffstat:
Mtext.c | 3++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/text.c b/text.c @@ -1341,13 +1341,14 @@ const char *text_newline_char(Text *txt) { } static bool text_iterator_init(Iterator *it, size_t pos, Piece *p, size_t off) { - *it = (Iterator){ + Iterator iter = (Iterator){ .pos = pos, .piece = p, .start = p ? p->data : NULL, .end = p ? p->data + p->len : NULL, .text = p ? p->data + off : NULL, }; + *it = iter; return text_iterator_valid(it); }