Andrew's git
/
gitweb.git
/ blobdiff
summary
|
log
|
commit
|
diff
|
tree
commit
grep
author
committer
pickaxe
?
re
push: further clean up fields of "struct ref"
[gitweb.git]
/
strbuf.c
diff --git
a/strbuf.c
b/strbuf.c
index 0510f76c24b3b3ce66baa0f05054d3f01b960b6e..4b9e30cadcd1ff45e7d4f23b210b22006445da91 100644
(file)
--- a/
strbuf.c
+++ b/
strbuf.c
@@
-44,7
+44,9
@@
void strbuf_release(struct strbuf *sb)
char *strbuf_detach(struct strbuf *sb, size_t *sz)
{
- char *res = sb->alloc ? sb->buf : NULL;
+ char *res;
+ strbuf_grow(sb, 0);
+ res = sb->buf;
if (sz)
*sz = sb->len;
strbuf_init(sb, 0);