]> granicus.if.org Git - vim/commitdiff
patch 8.2.4958: a couple conditions are always true v8.2.4958
author=?UTF-8?q?Dundar=20G=C3=B6c?= <gocdundar@gmail.com>
Sun, 15 May 2022 12:59:11 +0000 (13:59 +0100)
committerBram Moolenaar <Bram@vim.org>
Sun, 15 May 2022 12:59:11 +0000 (13:59 +0100)
Problem:    A couple conditions are always true.
Solution:   Remove the conditions. (Goc Dundar, closes #10428)

src/evalfunc.c
src/quickfix.c
src/version.c

index f7a04fdc9823155f508dc46fdd46e3e2af029c3d..2c012d047efac4e42c17ee2999ecb074c826167f 100644 (file)
@@ -9788,43 +9788,40 @@ f_spellsuggest(typval_T *argvars UNUSED, typval_T *rettv)
     }
 
 #ifdef FEAT_SPELL
-    if (*curwin->w_s->b_p_spl != NUL)
+    str = tv_get_string(&argvars[0]);
+    if (argvars[1].v_type != VAR_UNKNOWN)
     {
-       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)
        {
-           maxcount = (int)tv_get_number_chk(&argvars[1], &typeerr);
-           if (maxcount <= 0)
+           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;
+    }
+    else
+       maxcount = 25;
 
-       spell_suggest_list(&ga, str, maxcount, need_capital, FALSE);
+    spell_suggest_list(&ga, str, maxcount, need_capital, FALSE);
 
-       for (i = 0; i < ga.ga_len; ++i)
-       {
-           str = ((char_u **)ga.ga_data)[i];
+    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);
-           }
+       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);
     }
+    ga_clear(&ga);
     curwin->w_p_spell = wo_spell_save;
 #endif
 }
index aab1683f329c6f17f0becb234199bc6a68db91bd..dde3f9d566418d364b47d7a42fa5ec500b16bd63 100644 (file)
@@ -2494,7 +2494,7 @@ qf_push_dir(char_u *dirbuf, struct dir_stack_T **stackptr, int is_file_stack)
     // 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
     {
index 711349a35fb3c90b42d59ba944e603166e87bc43..856922e1f512ee7cdfe6614c3b9fadfe42477a42 100644 (file)
@@ -746,6 +746,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    4958,
 /**/
     4957,
 /**/