Mercurial > vim
changeset 25802:5ef704de7709 v8.2.3436
patch 8.2.3436: check for optional bool type has confusing return type
Commit: https://github.com/vim/vim/commit/a29856fcdc41541c607437629c1c1f45951100a4
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon Sep 13 21:36:27 2021 +0200
patch 8.2.3436: check for optional bool type has confusing return type
Problem: Check for optional bool type has confusing return type.
Solution: Explicitly return OK.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 13 Sep 2021 21:45:04 +0200 |
parents | 7124fbe5db04 |
children | 49b36fc6ec04 |
files | src/typval.c src/version.c |
diffstat | 2 files changed, 7 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/src/typval.c +++ b/src/typval.c @@ -459,13 +459,15 @@ check_for_bool_arg(typval_T *args, int i } /* - * 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); } /*