From: Rajesh Nambiar Date: Sun, 31 May 2015 14:36:08 +0000 (+0000) Subject: Allow float value by allowing . in input value X-Git-Tag: v9.0.1~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=4487d13cc6a737d36f6cfafdf7c28ef6423e17c1;p=ceph.git Allow float value by allowing . in input value Dont bail out if the input value happens to be . Fixes: #11620 Signed-off-by: Rajesh Nambiar Tested-by: Sage Weil --- diff --git a/src/common/ceph_argparse.cc b/src/common/ceph_argparse.cc index 400edee17d57..924b68077f2b 100644 --- a/src/common/ceph_argparse.cc +++ b/src/common/ceph_argparse.cc @@ -154,6 +154,7 @@ void vec_to_argv(const char *argv0, std::vector& args, void ceph_arg_value_type(const char * nextargstr, bool *bool_option, bool *bool_numeric) { bool is_numeric = true; + bool is_float = false; bool is_option; if (nextargstr == NULL) { @@ -173,6 +174,11 @@ void ceph_arg_value_type(const char * nextargstr, bool *bool_option, bool *bool_ if (nextargstr[0] == '-') continue; } + if ( (nextargstr[i] == '.') && (is_float == false) ) { + is_float = true; + continue; + } + is_numeric = false; break; }