From f1f75dffb9591e817825fb0115cb1ff1f5ad7cde Mon Sep 17 00:00:00 2001 From: Colin Patrick McCabe Date: Thu, 23 Jun 2011 10:45:54 -0700 Subject: [PATCH] ceph_argparse_witharg: fix dashes in args Signed-off-by: Colin McCabe --- src/common/ceph_argparse.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/common/ceph_argparse.cc b/src/common/ceph_argparse.cc index 6f13ffb6988b3..5f6b745a12158 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); -- 2.39.5