patch 8.1.1032: warnings from clang static analyzer
Problem: Warnings from clang static analyzer. (Yegappan Lakshmanan)
Solution: Fix relevant warnings.
diff --git a/src/edit.c b/src/edit.c
index 2f81b52..452d4a6 100644
--- a/src/edit.c
+++ b/src/edit.c
@@ -4109,11 +4109,11 @@
static buf_T *
ins_compl_next_buf(buf_T *buf, int flag)
{
- static win_T *wp;
+ static win_T *wp = NULL;
- if (flag == 'w') /* just windows */
+ if (flag == 'w') // just windows
{
- if (buf == curbuf) /* first call for this flag/expansion */
+ if (buf == curbuf || wp == NULL) // first call for this flag/expansion
wp = curwin;
while ((wp = (wp->w_next != NULL ? wp->w_next : firstwin)) != curwin
&& wp->w_buffer->b_scanned)