mon: fix Monitor::_get_moncommand()

It should match command prefix, not any substring.

Signed-off-by: Mykola Golub <mgolub@mirantis.com>
This commit is contained in:
Mykola Golub 2015-01-28 10:45:59 +02:00 committed by Sage Weil
parent 14dbe1ded2
commit 3ff4821307

View File

@ -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;
}