]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph_argparse_witharg: fix dashes in args
authorColin Patrick McCabe <cmccabe@alumni.cmu.edu>
Thu, 23 Jun 2011 17:45:54 +0000 (10:45 -0700)
committerColin Patrick McCabe <cmccabe@alumni.cmu.edu>
Thu, 23 Jun 2011 17:45:54 +0000 (10:45 -0700)
Signed-off-by: Colin McCabe <colin.mccabe@dreamhost.com>
src/common/ceph_argparse.cc

index 6f13ffb6988b3ae9928af6c537262b764e1dff87..5f6b745a12158647da65c8e7b83c850893aa0bc7 100644 (file)
@@ -305,7 +305,9 @@ bool ceph_argparse_witharg(std::vector<const char*> &args,
     if (a == NULL)
       return false;
     strlen_a = strlen(a);
-    if (strncmp(a, first, strlen(a)) == 0) {
+    char a2[strlen_a+1];
+    dashes_to_underscores(a, a2);
+    if (strncmp(a2, first, strlen(a2)) == 0) {
       if (first[strlen_a] == '=') {
        *ret = first + strlen_a + 1;
        i = args.erase(i);