summaryrefslogtreecommitdiff
path: root/commit.c
diff options
context:
space:
mode:
authorPierre Habouzit <madcoder@debian.org>2007-09-20 00:42:12 +0200
committerJunio C Hamano <gitster@pobox.com>2007-09-20 23:17:40 -0700
commitc76689df6c64a1e987bd779bd71a2042b5131fb9 (patch)
tree22f810d6b67ed4bd03bfafb244eb9e6012502476 /commit.c
parent19247e5510279f018f8358a72b38cc5aa62fac8a (diff)
downloadgit-c76689df6c64a1e987bd779bd71a2042b5131fb9.tar.gz
strbuf API additions and enhancements.
Add strbuf_remove, change strbuf_insert: As both are special cases of strbuf_splice, implement them as such. gcc is able to do the math and generate almost optimal code this way. Add strbuf_swap: Exchange the values of its arguments. Use it in fast-import.c Also fix spacing issues in strbuf.h Signed-off-by: Pierre Habouzit <madcoder@debian.org>
Diffstat (limited to 'commit.c')
-rw-r--r--commit.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/commit.c b/commit.c
index f86fa776c0..55b08ec0b9 100644
--- a/commit.c
+++ b/commit.c
@@ -656,7 +656,7 @@ static char *replace_encoding_header(char *buf, const char *encoding)
strbuf_attach(&tmp, buf, strlen(buf), strlen(buf) + 1);
if (is_encoding_utf8(encoding)) {
/* we have re-coded to UTF-8; drop the header */
- strbuf_splice(&tmp, start, len, NULL, 0);
+ strbuf_remove(&tmp, start, len);
} else {
/* just replaces XXXX in 'encoding XXXX\n' */
strbuf_splice(&tmp, start + strlen("encoding "),