Mercurial > vim
changeset 35287:b68266606e84 v9.1.0448
patch 9.1.0448: compiler warning in eval.c
Commit: https://github.com/vim/vim/commit/8904d672befb496cf224f01bc042683bb6120e81
Author: Yegappan Lakshmanan <yegappan@yahoo.com>
Date: Wed May 29 07:51:50 2024 +0200
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>
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Wed, 29 May 2024 08:00:04 +0200 |
parents | 40d555986d76 |
children | e0701cae97d4 |
files | src/eval.c src/version.c |
diffstat | 2 files changed, 22 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- a/src/eval.c +++ b/src/eval.c @@ -5761,22 +5761,31 @@ func_tv2string(typval_T *tv, char_u **to if (echo_style) { - r = tv->vval.v_string == NULL ? (char_u *)"function()" - : 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); - *tofree = r; + if (tv->vval.v_string == NULL) + { + r = (char_u *)"function()"; + *tofree = NULL; } 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 { - *tofree = string_quote(tv->vval.v_string == NULL ? NULL - : make_ufunc_name_readable(tv->vval.v_string, - buf, MAX_FUNC_NAME_LEN), TRUE); + if (tv->vval.v_string == NULL) + *tofree = string_quote(NULL, TRUE); + else + *tofree = string_quote(make_ufunc_name_readable(tv->vval.v_string, + buf, MAX_FUNC_NAME_LEN), TRUE); r = *tofree; }