summaryrefslogtreecommitdiff
path: root/src/typval.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2021-09-13 21:36:27 +0200
committerBram Moolenaar <Bram@vim.org>2021-09-13 21:36:27 +0200
commita29856fcdc41541c607437629c1c1f45951100a4 (patch)
treeff06dca350f51b3f8c70a947eeb4e5e7ad0accc3 /src/typval.c
parentb1b6f4de2b0edc3b6622912132ddb8994ec52709 (diff)
downloadvim-git-a29856fcdc41541c607437629c1c1f45951100a4.tar.gz
patch 8.2.3436: check for optional bool type has confusing return typev8.2.3436
Problem: Check for optional bool type has confusing return type. Solution: Explicitly return OK.
Diffstat (limited to 'src/typval.c')
-rw-r--r--src/typval.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/typval.c b/src/typval.c
index 5fb98eb67..3a0e2e5d9 100644
--- a/src/typval.c
+++ b/src/typval.c
@@ -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);
}
/*