summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 3c0ff44)
raw | patch | inline | side by side (parent: 3c0ff44)
author | René Scharfe <rene.scharfe@lsrfire.ath.cx> | |
Fri, 19 Feb 2010 22:16:45 +0000 (23:16 +0100) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Sat, 20 Feb 2010 17:19:35 +0000 (09:19 -0800) |
The patch before the previous one made sure that all callers of
strbuf_add_wrapped_text() supply a strbuf. Replace all calls of
strbuf_write() with regular strbuf functions and remove it.
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
strbuf_add_wrapped_text() supply a strbuf. Replace all calls of
strbuf_write() with regular strbuf functions and remove it.
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
utf8.c | patch | blob | history |
index a4e36ff33c4b7df768c3802f5278c3847c7810c1..9f64f59d664c81c9cce41bc51ef26aa913d96fb6 100644 (file)
--- a/utf8.c
+++ b/utf8.c
return 1;
}
-static inline void strbuf_write(struct strbuf *sb, const char *buf, int len)
-{
- if (sb)
- strbuf_insert(sb, sb->len, buf, len);
- else
- fwrite(buf, len, 1, stdout);
-}
-
static void strbuf_addchars(struct strbuf *sb, int c, size_t n)
{
strbuf_grow(sb, n);
if (*eol == '\n')
eol++;
strbuf_addchars(buf, ' ', indent);
- strbuf_write(buf, text, eol - text);
+ strbuf_add(buf, text, eol - text);
text = eol;
indent = indent2;
}
start = space;
else
strbuf_addchars(buf, ' ', indent);
- strbuf_write(buf, start, text - start);
+ strbuf_add(buf, start, text - start);
if (!c)
return w;
space = text;
else if (c == '\n') {
space++;
if (*space == '\n') {
- strbuf_write(buf, "\n", 1);
+ strbuf_addch(buf, '\n');
goto new_line;
}
else if (!isalnum(*space))
goto new_line;
else
- strbuf_write(buf, " ", 1);
+ strbuf_addch(buf, ' ');
}
w++;
text++;
}
else {
new_line:
- strbuf_write(buf, "\n", 1);
+ strbuf_addch(buf, '\n');
text = bol = space + isspace(*space);
space = NULL;
w = indent = indent2;