From ce81496fab8cea588631dded376a88de347c58f0 Mon Sep 17 00:00:00 2001 From: Johnny Chen Date: Wed, 1 Dec 2010 01:04:22 +0000 Subject: Make CommandObjectMultiword::GetSubcommandSP() more robust by appending the exactly-matched sub_cmd to the passed in 'matches' string list. llvm-svn: 120516 --- lldb/source/Commands/CommandObjectMultiword.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'lldb/source/Commands/CommandObjectMultiword.cpp') diff --git a/lldb/source/Commands/CommandObjectMultiword.cpp b/lldb/source/Commands/CommandObjectMultiword.cpp index aafd0f8..db500a7 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 { -- cgit v1.1