]> granicus.if.org Git - vim/commitdiff
patch 8.2.3436: check for optional bool type has confusing return type v8.2.3436
authorBram Moolenaar <Bram@vim.org>
Mon, 13 Sep 2021 19:36:27 +0000 (21:36 +0200)
committerBram Moolenaar <Bram@vim.org>
Mon, 13 Sep 2021 19:36:27 +0000 (21:36 +0200)
Problem:    Check for optional bool type has confusing return type.
Solution:   Explicitly return OK.

src/typval.c
src/version.c

index 5fb98eb6733ab618aed7b8cb11dda7b5a075c03a..3a0e2e5d99ee10f3d1c8d7fabc8ff238bf83fc7a 100644 (file)
@@ -459,13 +459,15 @@ check_for_bool_arg(typval_T *args, int idx)
 }
 
 /*
- * Check for an optional bool argument at 'idx'
+ * Check for an optional bool argument at 'idx'.
+ * Return FAIL if the type is wrong.
  */
     int
 check_for_opt_bool_arg(typval_T *args, int idx)
 {
-    return (args[idx].v_type == VAR_UNKNOWN
-           || check_for_bool_arg(args, idx) != FAIL);
+    if (args[idx].v_type == VAR_UNKNOWN)
+       return OK;
+    return check_for_bool_arg(args, idx);
 }
 
 /*
index 8973e482b2bc20f1aa1e6a0d25c7b68945b842f9..6fd967c12971135f7d026e713f7df95f1f41d063 100644 (file)
@@ -755,6 +755,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    3436,
 /**/
     3435,
 /**/