From: Colin Patrick McCabe Date: Thu, 5 May 2011 23:17:34 +0000 (-0700) Subject: ceph_argparse: ignore dashes after equals sign X-Git-Tag: v0.28~73 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=3ee41ab83cfeeef6db7d28d99a90b1cbdcc416e5;p=ceph.git 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 --- diff --git a/src/common/ceph_argparse.cc b/src/common/ceph_argparse.cc index 6a7b6253a5a..c6f7cdcd9dc 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'; }