]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: fix Monitor::_get_moncommand()
authorMykola Golub <mgolub@mirantis.com>
Wed, 28 Jan 2015 08:45:59 +0000 (10:45 +0200)
committerSage Weil <sage@redhat.com>
Mon, 9 Feb 2015 06:12:55 +0000 (22:12 -0800)
It should match command prefix, not any substring.

Signed-off-by: Mykola Golub <mgolub@mirantis.com>
src/mon/Monitor.cc

index 6344b32b56c4457c66eedc2b57c7d8b61de6067d..1d6030826b49c66e65b642c82fae3699cb651fef 100644 (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;
     }