Can you add a test with the examples you summarized?  What does a\b generate with this change?<br><div class="gmail_quote">On Tue, Feb 24, 2015 at 3:11 AM Pavel Labath <<a href="mailto:labath@google.com">labath@google.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi clayborg,<br>
<br>
Presently Args::SetCommandString allows quotes to be escaped with backslash. However, the<br>
backslash itself is not removed from the argument, nor there is a way to escape the backslash<br>
itself. This leads to surprising results:<br>
<br>
"a b" c"   -> 'a b', 'c'  # Here we actually have an unterminated quote, but that is ignored<br>
"a b\" c"  -> 'a b\" c'   # We try to escape the quote. That works but the backslash is not removed.<br>
"a b\\" c" -> 'a b\\" c'  # Escaping the backslash has no effect.<br>
<br>
This change removes the possibility to escape the terminating quotes, making every quote run from<br>
one quote character to the next one. The contents for the quote are always taken literally, just<br>
like the single quotes in a posix shell. The only way to insert a literal quote character is to<br>
close the quote and then escape it with a backslash or to use a different kind of quotes.<br>
<br>
To summarize:<br>
"a b" c"    -> 'a b', 'c'   # unterminated quotes are still ignored<br>
"a b"\"" c" -> 'a b" c'     # first way to insert a literal quote<br>
'a b" c'    -> 'a b" c'     # second way to insert a literal quote<br>
"a b\" c    -> 'a b\', c    # backslash has no effect, we still get two arguments<br>
"a b\\" c   -> 'a b\\', c   # same here<br>
<br>
This change also removes some dead quote-handling code. This code (branching on the value of<br>
quote_char) was never executed since all quote handling was concentrated in the case '"': block,<br>
and the value was always set to 0 after exiting the block.<br>
<br>
<a href="http://reviews.llvm.org/D7855" target="_blank">http://reviews.llvm.org/D7855</a><br>
<br>
Files:<br>
  source/Interpreter/Args.cpp<br>
<br>
EMAIL PREFERENCES<br>
  <a href="http://reviews.llvm.org/settings/panel/emailpreferences/" target="_blank">http://reviews.llvm.org/<u></u>settings/panel/<u></u>emailpreferences/</a><br>
______________________________<u></u>_________________<br>
lldb-commits mailing list<br>
<a href="mailto:lldb-commits@cs.uiuc.edu" target="_blank">lldb-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/lldb-commits" target="_blank">http://lists.cs.uiuc.edu/<u></u>mailman/listinfo/lldb-commits</a><br>
</blockquote></div>