* [PATCH] use strbuf_addch for adding single characters
@ 2014-07-10 8:54 René Scharfe
0 siblings, 0 replies; only message in thread
From: René Scharfe @ 2014-07-10 8:54 UTC (permalink / raw)
To: Git Mailing List; +Cc: Junio C Hamano
Signed-off-by: Rene Scharfe <l.s.r@web.de>
---
merge-recursive.c | 2 +-
pathspec.c | 2 +-
url.c | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/merge-recursive.c b/merge-recursive.c
index b5c3c53..fad7b2c 100644
--- a/merge-recursive.c
+++ b/merge-recursive.c
@@ -171,7 +171,7 @@ static void output(struct merge_options *o, int v, const char *fmt, ...)
strbuf_vaddf(&o->obuf, fmt, ap);
va_end(ap);
- strbuf_add(&o->obuf, "\n", 1);
+ strbuf_addch(&o->obuf, '\n');
if (!o->buffer_output)
flush_output(o);
}
diff --git a/pathspec.c b/pathspec.c
index 8043099..89f2c8f 100644
--- a/pathspec.c
+++ b/pathspec.c
@@ -338,7 +338,7 @@ static void NORETURN unsupported_magic(const char *pattern,
if (!(magic & m->bit))
continue;
if (sb.len)
- strbuf_addstr(&sb, " ");
+ strbuf_addch(&sb, ' ');
if (short_magic & m->bit)
strbuf_addf(&sb, "'%c'", m->mnemonic);
else
diff --git a/url.c b/url.c
index 335d97d..7ca2a69 100644
--- a/url.c
+++ b/url.c
@@ -121,7 +121,7 @@ void end_url_with_slash(struct strbuf *buf, const char *url)
{
strbuf_addstr(buf, url);
if (buf->len && buf->buf[buf->len - 1] != '/')
- strbuf_addstr(buf, "/");
+ strbuf_addch(buf, '/');
}
void str_end_url_with_slash(const char *url, char **dest) {
--
2.0.0
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2014-07-10 8:54 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-10 8:54 [PATCH] use strbuf_addch for adding single characters René Scharfe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).