From: Mykola Golub Date: Wed, 28 Jan 2015 08:45:59 +0000 (+0200) Subject: mon: fix Monitor::_get_moncommand() X-Git-Tag: v0.93~77 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=3ff482130727e7da5f4d31d59c0cf648c3bb5515;p=ceph.git mon: fix Monitor::_get_moncommand() It should match command prefix, not any substring. Signed-off-by: Mykola Golub --- diff --git a/src/mon/Monitor.cc b/src/mon/Monitor.cc index 6344b32b56c4..1d6030826b49 100644 --- a/src/mon/Monitor.cc +++ b/src/mon/Monitor.cc @@ -2430,7 +2430,7 @@ const MonCommand *Monitor::_get_moncommand(const string &cmd_prefix, MonCommand *this_cmd = NULL; for (MonCommand *cp = cmds; cp < &cmds[cmds_size]; cp++) { - if (cp->cmdstring.find(cmd_prefix) != string::npos) { + if (cp->cmdstring.compare(0, cmd_prefix.size(), cmd_prefix) == 0) { this_cmd = cp; break; }