]> granicus.if.org Git - vim/commitdiff
patch 9.0.1401: condition is always true v9.0.1401
authorzeertzjq <zeertzjq@outlook.com>
Sat, 11 Mar 2023 16:18:51 +0000 (16:18 +0000)
committerBram Moolenaar <Bram@vim.org>
Sat, 11 Mar 2023 16:18:51 +0000 (16:18 +0000)
Problem:    Condition is always true.
Solution:   Remove the condition. (closes #12139)

src/eval.c
src/version.c

index c82e7046d00dffdd84e443065db9cd7324c855a7..37b50c38e654a6d36b1a0e2755a9e05294a6de40 100644 (file)
@@ -6885,20 +6885,17 @@ handle_subscript(
                *arg = skipwhite(p + 2);
            else
                *arg = p + 2;
-           if (ret == OK)
+           if (VIM_ISWHITE(**arg))
            {
-               if (VIM_ISWHITE(**arg))
-               {
-                   emsg(_(e_no_white_space_allowed_before_parenthesis));
-                   ret = FAIL;
-               }
-               else if ((**arg == '{' && !in_vim9script()) || **arg == '(')
-                   // expr->{lambda}() or expr->(lambda)()
-                   ret = eval_lambda(arg, rettv, evalarg, verbose);
-               else
-                   // expr->name()
-                   ret = eval_method(arg, rettv, evalarg, verbose);
+               emsg(_(e_no_white_space_allowed_before_parenthesis));
+               ret = FAIL;
            }
+           else if ((**arg == '{' && !in_vim9script()) || **arg == '(')
+               // expr->{lambda}() or expr->(lambda)()
+               ret = eval_lambda(arg, rettv, evalarg, verbose);
+           else
+               // expr->name()
+               ret = eval_method(arg, rettv, evalarg, verbose);
        }
        // "." is ".name" lookup when we found a dict or when evaluating and
        // scriptversion is at least 2, where string concatenation is "..".
index b1d88f4851882cd45c924906650c2296e1e15b67..0265c47a90f6954cb1c8054ce3ad046ce737fed6 100644 (file)
@@ -695,6 +695,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1401,
 /**/
     1400,
 /**/