summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJim Ingham <jingham@apple.com>2014-08-27 22:06:58 +0000
committerJim Ingham <jingham@apple.com>2014-08-27 22:06:58 +0000
commitdc498e516fb2a32df1c3b7a1dc1c8f773d73f52d (patch)
tree6b59502fbf1595f371927b30e07e57ae97005fd0
parent4eb1b271fc0c23eaa912e1f850429a811abc8b2a (diff)
downloadbcm5719-llvm-dc498e516fb2a32df1c3b7a1dc1c8f773d73f52d.tar.gz
bcm5719-llvm-dc498e516fb2a32df1c3b7a1dc1c8f773d73f52d.zip
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> llvm-svn: 216626
-rw-r--r--lldb/source/Interpreter/Args.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/lldb/source/Interpreter/Args.cpp b/lldb/source/Interpreter/Args.cpp
index 0b8f3e1a917..4831eaaac34 100644
--- a/lldb/source/Interpreter/Args.cpp
+++ b/lldb/source/Interpreter/Args.cpp
@@ -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,
OpenPOWER on IntegriCloud