From 289d81645f0d439f0f9f3aba1427e99595efc6f0 Mon Sep 17 00:00:00 2001 From: Danny Al-Gaaf Date: Wed, 27 Feb 2013 16:40:37 +0100 Subject: [PATCH] ceph_argparse.cc: accept also 0/1 for boolean injectargs Accept also 0 (as false) and 1 (true) as arguments for boolean option on injectargs. Fixes: #4261 Signed-off-by: Danny Al-Gaaf --- src/common/ceph_argparse.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/ceph_argparse.cc b/src/common/ceph_argparse.cc index 64e1288cfa89..889c713d736f 100644 --- a/src/common/ceph_argparse.cc +++ b/src/common/ceph_argparse.cc @@ -215,11 +215,11 @@ static bool va_ceph_argparse_binary_flag(std::vector &args, if (first[strlen_a] == '=') { i = args.erase(i); const char *val = first + strlen_a + 1; - if (strcmp(val, "true") == 0) { + if ((strcmp(val, "true") == 0) || (strcmp(val, "1") == 0)) { *ret = 1; return true; } - else if (strcmp(val, "false") == 0) { + else if ((strcmp(val, "false") == 0) || (strcmp(val, "0") == 0)) { *ret = 0; return true; } -- 2.47.3