[Lldb-commits] [lldb] r216626 - A quoted - is not the beginning of an option, and should not be completed as such. This was causing:

Jim Ingham jingham at apple.com
Wed Aug 27 15:06:58 PDT 2014


Author: jingham
Date: Wed Aug 27 17:06:58 2014
New Revision: 216626

URL: http://llvm.org/viewvc/llvm-project?rev=216626&view=rev
Log:
A quoted - is not the beginning of an option, and should not be completed as such.  This was causing:

(lldb) disassemble -n '-<TAB>

to crash.

<rdar://problem/18134531>

Modified:
    lldb/trunk/source/Interpreter/Args.cpp

Modified: lldb/trunk/source/Interpreter/Args.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/Args.cpp?rev=216626&r1=216625&r2=216626&view=diff
==============================================================================
--- lldb/trunk/source/Interpreter/Args.cpp (original)
+++ lldb/trunk/source/Interpreter/Args.cpp Wed Aug 27 17:06:58 2014
@@ -1644,8 +1644,10 @@ Args::ParseArgsForCompletion
     // Finally we have to handle the case where the cursor index points at a single "-".  We want to mark that in
     // the option_element_vector, but only if it is not after the "--".  But it turns out that OptionParser::Parse just ignores
     // an isolated "-".  So we have to look it up by hand here.  We only care if it is AT the cursor position.
+    // Note, a single quoted dash is not the same as a single dash...
     
     if ((static_cast<int32_t>(dash_dash_pos) == -1 || cursor_index < dash_dash_pos)
+         && m_args_quote_char[cursor_index] == '\0'
          && strcmp (GetArgumentAtIndex(cursor_index), "-") == 0)
     {
         option_element_vector.push_back (OptionArgElement (OptionArgElement::eBareDash, cursor_index, 





More information about the lldb-commits mailing list