Presently Args::SetCommandString allows quotes to be escaped with backslash. However, the
backslash itself is not removed from the argument, nor there is a way to escape the backslash
itself. This leads to surprising results:
"a b" c" -> 'a b', 'c' # Here we actually have an unterminated quote, but that is ignored
"a b\" c" -> 'a b\" c' # We try to escape the quote. That works but the backslash is not removed.
"a b\\" c" -> 'a b\\" c' # Escaping the backslash has no effect.
This change removes the possibility to escape the terminating quotes, making every quote run from
one quote character to the next one. The contents for the quote are always taken literally, just
like the single quotes in a posix shell. The only way to insert a literal quote character is to
close the quote and then escape it with a backslash or to use a different kind of quotes.
To summarize:
"a b" c" -> 'a b', 'c' # unterminated quotes are still ignored
"a b"\"" c" -> 'a b" c' # first way to insert a literal quote
'a b" c' -> 'a b" c' # second way to insert a literal quote
"a b\" c -> 'a b\', c # backslash has no effect, we still get two arguments
"a b\\" c -> 'a b\\', c # same here
This change also removes some dead quote-handling code. This code (branching on the value of
quote_char) was never executed since all quote handling was concentrated in the case '"': block,
and the value was always set to 0 after exiting the block.
You can remove this function now that we have a llvm::StringRef version.