diff options
author | Johnny Chen <johnny.chen@apple.com> | 2010-12-01 01:04:22 +0000 |
---|---|---|
committer | Johnny Chen <johnny.chen@apple.com> | 2010-12-01 01:04:22 +0000 |
commit | ce81496fab8cea588631dded376a88de347c58f0 (patch) | |
tree | d4d4e6de72e4fbccb57a795d13f612230adbc3aa /lldb/source/Commands/CommandObjectMultiword.cpp | |
parent | 19e302bc700d02913490537169ace6450b4913f4 (diff) | |
download | bcm5719-llvm-ce81496fab8cea588631dded376a88de347c58f0.tar.gz bcm5719-llvm-ce81496fab8cea588631dded376a88de347c58f0.zip |
Make CommandObjectMultiword::GetSubcommandSP() more robust by appending the
exactly-matched sub_cmd to the passed in 'matches' string list.
llvm-svn: 120516
Diffstat (limited to 'lldb/source/Commands/CommandObjectMultiword.cpp')
-rw-r--r-- | lldb/source/Commands/CommandObjectMultiword.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lldb/source/Commands/CommandObjectMultiword.cpp b/lldb/source/Commands/CommandObjectMultiword.cpp index aafd0f8147d..db500a7f66c 100644 --- a/lldb/source/Commands/CommandObjectMultiword.cpp +++ b/lldb/source/Commands/CommandObjectMultiword.cpp @@ -49,8 +49,12 @@ CommandObjectMultiword::GetSubcommandSP (const char *sub_cmd, StringList *matche if (!m_subcommand_dict.empty()) { pos = m_subcommand_dict.find (sub_cmd); - if (pos != m_subcommand_dict.end()) + if (pos != m_subcommand_dict.end()) { + // An exact match; append the sub_cmd to the 'matches' string list. + if (matches) + matches->AppendString(sub_cmd); return_cmd_sp = pos->second; + } else { |