From: Colin Patrick McCabe Date: Thu, 23 Jun 2011 17:45:54 +0000 (-0700) Subject: ceph_argparse_witharg: fix dashes in args X-Git-Tag: v0.30~8 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=f1f75dffb9591e817825fb0115cb1ff1f5ad7cde;p=ceph.git ceph_argparse_witharg: fix dashes in args Signed-off-by: Colin McCabe --- diff --git a/src/common/ceph_argparse.cc b/src/common/ceph_argparse.cc index 6f13ffb6988..5f6b745a121 100644 --- a/src/common/ceph_argparse.cc +++ b/src/common/ceph_argparse.cc @@ -305,7 +305,9 @@ bool ceph_argparse_witharg(std::vector &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);