]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Allow float value by allowing . in input value
authorRajesh Nambiar <rajesh.n@msystechnologies.com>
Sun, 31 May 2015 14:36:08 +0000 (14:36 +0000)
committerSage Weil <sage@redhat.com>
Sun, 31 May 2015 16:38:03 +0000 (12:38 -0400)
Dont bail out if the input value happens to be .

Fixes: #11620
Signed-off-by: Rajesh Nambiar <rajesh.n@msystechnologies.com>
Tested-by: Sage Weil <sage@redhat.com>
src/common/ceph_argparse.cc

index 400edee17d5772e37a42d66b14c65632b21d31ac..924b68077f2be9a58d3901245d074b481f34b400 100644 (file)
@@ -154,6 +154,7 @@ void vec_to_argv(const char *argv0, std::vector<const char*>& 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;
     }