apply: convert root string to strbuf
commit6c31c22cebe9f0b117fd93ee7792d88e82aaa61e
authorJeff King <peff@peff.net>
Thu, 24 Sep 2015 21:07:38 +0000 (24 17:07 -0400)
committerJunio C Hamano <gitster@pobox.com>
Mon, 5 Oct 2015 18:08:04 +0000 (5 11:08 -0700)
tree29f3af8a8309b8d070e33cbb0eb680b01177bf8f
parent9c28390bda4bb86f48a3145417c1cb1892782c47
apply: convert root string to strbuf

We use manual computation and strcpy to allocate the "root"
variable. This would be much simpler using xstrfmt.  But
since we store the length, too, we can just use a strbuf,
which handles that for us.

Note that we stop distinguishing between "no root" and
"empty root" in some cases, but that's OK; the results are
the same (e.g., inserting an empty string is a noop).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/apply.c