The reason we store the quote char, btw, is so that we can use the same
exact quoting as the user typed at command line. A general algorithm
wouldn't be able to reproduce exactly what the user typed
On Sat, Nov 19, 2016 at 9:43 AM Zachary Turner wrote:
> The main user of the c_str() is printf cal
The main user of the c_str() is printf calls. It's in the commit message :)
On Sat, Nov 19, 2016 at 7:14 AM Pavel Labath wrote:
> labath added a comment.
>
> > Assuming we do that, what interface do you think would be simpler? We
> still
> > need easy access to both a StringRef and a c_str(), si
labath added a comment.
> Assuming we do that, what interface do you think would be simpler? We still
> need easy access to both a StringRef and a c_str(), since StringRef::data
> is not guaranteed to be null terminated, so the entry thing is still nice.
I was assuming (possibly incorrectly, I
One idea might be to have the entry contain 2 StringRefs. `str` and
`quoted_str`. This way you never get access to the underlying quote char,
just the full arg, either quoted or unquoted (although doing this would
still be better done orthogonally to this patch)
On Sat, Nov 19, 2016 at 5:48 AM Zach
Assuming we do that, what interface do you think would be simpler? We still
need easy access to both a StringRef and a c_str(), since StringRef::data
is not guaranteed to be null terminated, so the entry thing is still nice.
On Sat, Nov 19, 2016 at 5:44 AM Zachary Turner wrote:
> The quote char i
The quote char is only exposed as a means to not break existing code which
depends on it (most of which, not surprisingly, is in the Args class itself.
We could try to come up with a way to kill it, but that seems like a
separate refactor (and perhaps quite difficult since different platforms
have
labath added a comment.
I don't know how deep do you want this refactor to be, but there is one issue I
would like us to consider, if only to decide it is out of scope of this change.
I am talking about the `quote_char` thingy. The main problem for me is that I
don't think it's possible to sane