• R/O
  • SSH

vim: コミット

Mirror of the Vim source from https://github.com/vim/vim


コミットメタ情報

リビジョン18604231a1d1cfe0c02fdd0a55b02ac6ddfc36bd (tree)
日時2022-05-15 22:00:02
作者Bram Moolenaar <Bram@vim....>
コミッターBram Moolenaar

ログメッセージ

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?= <gocdundar@gmail.com>
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 -r a865bf1c3ca9 -r 18604231a1d1 src/evalfunc.c
--- a/src/evalfunc.c Sun May 15 14:15:05 2022 +0200
+++ b/src/evalfunc.c Sun May 15 15:00:02 2022 +0200
@@ -9788,43 +9788,40 @@
97889788 }
97899789
97909790 #ifdef FEAT_SPELL
9791- if (*curwin->w_s->b_p_spl != NUL)
9792- {
9793- str = tv_get_string(&argvars[0]);
9794- if (argvars[1].v_type != VAR_UNKNOWN)
9795- {
9796- maxcount = (int)tv_get_number_chk(&argvars[1], &typeerr);
9797- if (maxcount <= 0)
9791+ str = tv_get_string(&argvars[0]);
9792+ if (argvars[1].v_type != VAR_UNKNOWN)
9793+ {
9794+ maxcount = (int)tv_get_number_chk(&argvars[1], &typeerr);
9795+ if (maxcount <= 0)
9796+ return;
9797+ if (argvars[2].v_type != VAR_UNKNOWN)
9798+ {
9799+ need_capital = (int)tv_get_bool_chk(&argvars[2], &typeerr);
9800+ if (typeerr)
97989801 return;
9799- if (argvars[2].v_type != VAR_UNKNOWN)
9800- {
9801- need_capital = (int)tv_get_bool_chk(&argvars[2], &typeerr);
9802- if (typeerr)
9803- return;
9804- }
9805- }
9802+ }
9803+ }
9804+ else
9805+ maxcount = 25;
9806+
9807+ spell_suggest_list(&ga, str, maxcount, need_capital, FALSE);
9808+
9809+ for (i = 0; i < ga.ga_len; ++i)
9810+ {
9811+ str = ((char_u **)ga.ga_data)[i];
9812+
9813+ li = listitem_alloc();
9814+ if (li == NULL)
9815+ vim_free(str);
98069816 else
9807- maxcount = 25;
9808-
9809- spell_suggest_list(&ga, str, maxcount, need_capital, FALSE);
9810-
9811- for (i = 0; i < ga.ga_len; ++i)
9812- {
9813- str = ((char_u **)ga.ga_data)[i];
9814-
9815- li = listitem_alloc();
9816- if (li == NULL)
9817- vim_free(str);
9818- else
9819- {
9820- li->li_tv.v_type = VAR_STRING;
9821- li->li_tv.v_lock = 0;
9822- li->li_tv.vval.v_string = str;
9823- list_append(rettv->vval.v_list, li);
9824- }
9825- }
9826- ga_clear(&ga);
9827- }
9817+ {
9818+ li->li_tv.v_type = VAR_STRING;
9819+ li->li_tv.v_lock = 0;
9820+ li->li_tv.vval.v_string = str;
9821+ list_append(rettv->vval.v_list, li);
9822+ }
9823+ }
9824+ ga_clear(&ga);
98289825 curwin->w_p_spell = wo_spell_save;
98299826 #endif
98309827 }
diff -r a865bf1c3ca9 -r 18604231a1d1 src/quickfix.c
--- a/src/quickfix.c Sun May 15 14:15:05 2022 +0200
+++ b/src/quickfix.c Sun May 15 15:00:02 2022 +0200
@@ -2494,7 +2494,7 @@
24942494 // store directory on the stack
24952495 if (vim_isAbsName(dirbuf)
24962496 || (*stackptr)->next == NULL
2497- || (*stackptr && is_file_stack))
2497+ || is_file_stack)
24982498 (*stackptr)->dirname = vim_strsave(dirbuf);
24992499 else
25002500 {
diff -r a865bf1c3ca9 -r 18604231a1d1 src/version.c
--- a/src/version.c Sun May 15 14:15:05 2022 +0200
+++ b/src/version.c Sun May 15 15:00:02 2022 +0200
@@ -747,6 +747,8 @@
747747 static int included_patches[] =
748748 { /* Add new patch number below this line */
749749 /**/
750+ 4958,
751+/**/
750752 4957,
751753 /**/
752754 4956,
旧リポジトリブラウザで表示