remote-curl: store url as a strbuf
commitb227bbc43a568b282b5f8cb35e563d00d60b272d
authorJeff King <peff@peff.net>
Sat, 28 Sep 2013 08:35:25 +0000 (28 04:35 -0400)
committerJonathan Nieder <jrnieder@gmail.com>
Tue, 15 Oct 2013 00:01:15 +0000 (14 17:01 -0700)
tree49d40f0b923fdcea9c7ef770dff333732365edc7
parentc65d5692cd3434133c2e8f1a20074a261e0267f0
remote-curl: store url as a strbuf

We use a strbuf to generate the string containing the remote
URL, but then detach it to a bare pointer. This makes it
harder to later manipulate the URL, as we have forgotten the
length (and the allocation semantics are not as clear).

Let's instead keep the strbuf around. As a bonus, this
eliminates a confusing double-use of the "buf" strbuf in
main(). Prior to this, it was used both for constructing the
url, and for reading commands from stdin.

The downside is that we have to update each call site to
refer to "url.buf" rather than just "url" when they want the
C string.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
remote-curl.c