patch 8.0.1496: clearing a pointer takes two lines
Problem: Clearing a pointer takes two lines.
Solution: Add VIM_CLEAR() and replace vim_clear(). (Hirohito Higashi,
closes #2629)
diff --git a/src/userfunc.c b/src/userfunc.c
index 931683d..df72e34 100644
--- a/src/userfunc.c
+++ b/src/userfunc.c
@@ -2122,10 +2122,7 @@
/* between ":append" and "." and between ":python <<EOF" and "EOF"
* don't check for ":endfunc". */
if (STRCMP(theline, skip_until) == 0)
- {
- vim_free(skip_until);
- skip_until = NULL;
- }
+ VIM_CLEAR(skip_until);
}
else
{
@@ -2295,8 +2292,7 @@
/* redefine existing function */
ga_clear_strings(&(fp->uf_args));
ga_clear_strings(&(fp->uf_lines));
- vim_free(name);
- name = NULL;
+ VIM_CLEAR(name);
}
}
}