# HG changeset patch # User Bram Moolenaar # Date 1652619602 -7200 # Node ID 18604231a1d1cfe0c02fdd0a55b02ac6ddfc36bd # Parent a865bf1c3ca93b844993f5211f3fa34744b8b01e patch 8.2.4958: a couple conditions are always true Commit: https://github.com/vim/vim/commit/dd41037552c1be3548d2ce34bb1c889f14edb553 Author: =?UTF-8?q?Dundar=20G=C3=B6c?= Date: Sun May 15 13:59:11 2022 +0100 patch 8.2.4958: a couple conditions are always true Problem: A couple conditions are always true. Solution: Remove the conditions. (Goc Dundar, closes https://github.com/vim/vim/issues/10428) diff --git a/src/evalfunc.c b/src/evalfunc.c --- a/src/evalfunc.c +++ b/src/evalfunc.c @@ -9788,43 +9788,40 @@ f_spellsuggest(typval_T *argvars UNUSED, } #ifdef FEAT_SPELL - if (*curwin->w_s->b_p_spl != NUL) - { - str = tv_get_string(&argvars[0]); - if (argvars[1].v_type != VAR_UNKNOWN) - { - maxcount = (int)tv_get_number_chk(&argvars[1], &typeerr); - if (maxcount <= 0) + str = tv_get_string(&argvars[0]); + if (argvars[1].v_type != VAR_UNKNOWN) + { + maxcount = (int)tv_get_number_chk(&argvars[1], &typeerr); + if (maxcount <= 0) + return; + if (argvars[2].v_type != VAR_UNKNOWN) + { + need_capital = (int)tv_get_bool_chk(&argvars[2], &typeerr); + if (typeerr) return; - if (argvars[2].v_type != VAR_UNKNOWN) - { - need_capital = (int)tv_get_bool_chk(&argvars[2], &typeerr); - if (typeerr) - return; - } - } + } + } + else + maxcount = 25; + + spell_suggest_list(&ga, str, maxcount, need_capital, FALSE); + + for (i = 0; i < ga.ga_len; ++i) + { + str = ((char_u **)ga.ga_data)[i]; + + li = listitem_alloc(); + if (li == NULL) + vim_free(str); else - maxcount = 25; - - spell_suggest_list(&ga, str, maxcount, need_capital, FALSE); - - for (i = 0; i < ga.ga_len; ++i) - { - str = ((char_u **)ga.ga_data)[i]; - - li = listitem_alloc(); - if (li == NULL) - vim_free(str); - else - { - li->li_tv.v_type = VAR_STRING; - li->li_tv.v_lock = 0; - li->li_tv.vval.v_string = str; - list_append(rettv->vval.v_list, li); - } - } - ga_clear(&ga); - } + { + li->li_tv.v_type = VAR_STRING; + li->li_tv.v_lock = 0; + li->li_tv.vval.v_string = str; + list_append(rettv->vval.v_list, li); + } + } + ga_clear(&ga); curwin->w_p_spell = wo_spell_save; #endif } diff --git a/src/quickfix.c b/src/quickfix.c --- a/src/quickfix.c +++ b/src/quickfix.c @@ -2494,7 +2494,7 @@ qf_push_dir(char_u *dirbuf, struct dir_s // store directory on the stack if (vim_isAbsName(dirbuf) || (*stackptr)->next == NULL - || (*stackptr && is_file_stack)) + || is_file_stack) (*stackptr)->dirname = vim_strsave(dirbuf); else { diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -747,6 +747,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 4958, +/**/ 4957, /**/ 4956,