To: vim_dev@googlegroups.com Subject: Patch 8.2.4958 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.4958 Problem: A couple conditions are always true. Solution: Remove the conditions. (Goc Dundar, closes #10428) Files: src/evalfunc.c, src/quickfix.c *** ../vim-8.2.4957/src/evalfunc.c 2022-05-09 14:12:10.712386673 +0100 --- src/evalfunc.c 2022-05-15 13:55:36.020293197 +0100 *************** *** 9788,9830 **** } #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) 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 ! { ! 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 } --- 9788,9827 ---- } #ifdef FEAT_SPELL ! 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; } ! } ! 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); curwin->w_p_spell = wo_spell_save; #endif } *** ../vim-8.2.4957/src/quickfix.c 2022-04-15 13:53:30.052708679 +0100 --- src/quickfix.c 2022-05-15 13:57:42.356181713 +0100 *************** *** 2494,2500 **** // store directory on the stack if (vim_isAbsName(dirbuf) || (*stackptr)->next == NULL ! || (*stackptr && is_file_stack)) (*stackptr)->dirname = vim_strsave(dirbuf); else { --- 2494,2500 ---- // store directory on the stack if (vim_isAbsName(dirbuf) || (*stackptr)->next == NULL ! || is_file_stack) (*stackptr)->dirname = vim_strsave(dirbuf); else { *** ../vim-8.2.4957/src/version.c 2022-05-15 13:07:58.366684986 +0100 --- src/version.c 2022-05-15 13:56:37.960238583 +0100 *************** *** 748,749 **** --- 748,751 ---- { /* Add new patch number below this line */ + /**/ + 4958, /**/ -- panic("Foooooooood fight!"); -- In the kernel source aha1542.c, after detecting a bad segment list /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///