From 3ee41ab83cfeeef6db7d28d99a90b1cbdcc416e5 Mon Sep 17 00:00:00 2001 From: Colin Patrick McCabe Date: Thu, 5 May 2011 16:17:34 -0700 Subject: [PATCH] ceph_argparse: ignore dashes after equals sign When parsing argv, ignore dashes after equals signs. This is so that things like --log-file=/tmp/foo-file will work correctly. Signed-off-by: Colin McCabe --- src/common/ceph_argparse.cc | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/common/ceph_argparse.cc b/src/common/ceph_argparse.cc index 6a7b6253a5a5f..c6f7cdcd9dcc7 100644 --- a/src/common/ceph_argparse.cc +++ b/src/common/ceph_argparse.cc @@ -250,10 +250,14 @@ static void dashes_to_underscores(const char *input, char *output) if (*o++ == '\0') return; for (; ((c = *i)); ++i) { - if (c == '-') - *o++ = '_'; - else - *o++ = c; + if (c == '=') { + strcpy(o, i); + return; + } + if (c == '-') + *o++ = '_'; + else + *o++ = c; } *o++ = '\0'; } -- 2.47.3