builtin/merge.c: drop a parameter that is never used
[gitweb.git] / utf8.c
diff --git a/utf8.c b/utf8.c
index 197414af4c7cd257ea46f93ea52254c231ab9a63..0d20e0acb2b6fb2dd1d63abed676a036b2b7ec2f 100644 (file)
--- a/utf8.c
+++ b/utf8.c
@@ -9,7 +9,7 @@ struct interval {
   int last;
 };
 
-static size_t display_mode_esc_sequence_len(const char *s)
+size_t display_mode_esc_sequence_len(const char *s)
 {
        const char *p = s;
        if (*p++ != '\033')
@@ -463,8 +463,8 @@ void strbuf_utf8_replace(struct strbuf *sb_src, int pos, int width,
                w += n;
        }
        strbuf_setlen(&sb_dst, dst - sb_dst.buf);
-       strbuf_attach(sb_src, strbuf_detach(&sb_dst, NULL),
-                     sb_dst.len, sb_dst.alloc);
+       strbuf_swap(sb_src, &sb_dst);
+       strbuf_release(&sb_dst);
 }
 
 int is_encoding_utf8(const char *name)