forked from aniani/vim
patch 9.1.0448: compiler warning in eval.c
Problem: compiler warning in eval.c (after v9.1.0429) Solution: refactor code (Yegappan Lakshmanan) fixes: #14847 closes: #14867 Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
committed by
Christian Brabandt
parent
0b74eeceb8
commit
8904d672be
29
src/eval.c
29
src/eval.c
@@ -5761,22 +5761,31 @@ func_tv2string(typval_T *tv, char_u **tofree, int echo_style)
|
|||||||
|
|
||||||
if (echo_style)
|
if (echo_style)
|
||||||
{
|
{
|
||||||
r = tv->vval.v_string == NULL ? (char_u *)"function()"
|
if (tv->vval.v_string == NULL)
|
||||||
: make_ufunc_name_readable(tv->vval.v_string,
|
|
||||||
buf, MAX_FUNC_NAME_LEN);
|
|
||||||
if (r == buf && tv->vval.v_string != NULL)
|
|
||||||
{
|
{
|
||||||
r = vim_strsave(buf);
|
r = (char_u *)"function()";
|
||||||
*tofree = r;
|
*tofree = NULL;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
*tofree = NULL;
|
{
|
||||||
|
r = make_ufunc_name_readable(tv->vval.v_string, buf,
|
||||||
|
MAX_FUNC_NAME_LEN);
|
||||||
|
if (r == buf)
|
||||||
|
{
|
||||||
|
r = vim_strsave(buf);
|
||||||
|
*tofree = r;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
*tofree = NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
*tofree = string_quote(tv->vval.v_string == NULL ? NULL
|
if (tv->vval.v_string == NULL)
|
||||||
: make_ufunc_name_readable(tv->vval.v_string,
|
*tofree = string_quote(NULL, TRUE);
|
||||||
buf, MAX_FUNC_NAME_LEN), TRUE);
|
else
|
||||||
|
*tofree = string_quote(make_ufunc_name_readable(tv->vval.v_string,
|
||||||
|
buf, MAX_FUNC_NAME_LEN), TRUE);
|
||||||
r = *tofree;
|
r = *tofree;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -704,6 +704,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
448,
|
||||||
/**/
|
/**/
|
||||||
447,
|
447,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user