aboutsummaryrefslogtreecommitdiffstats
path: root/shared.c
diff options
context:
space:
mode:
Diffstat (limited to 'shared.c')
-rw-r--r--shared.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/shared.c b/shared.c
index 1fa9c99..10be355 100644
--- a/shared.c
+++ b/shared.c
@@ -130,6 +130,12 @@ char *ensure_end(const char *str, char c)
130 return result; 130 return result;
131} 131}
132 132
133void strbuf_ensure_end(struct strbuf *sb, char c)
134{
135 if (!sb->len || sb->buf[sb->len - 1] != c)
136 strbuf_addch(sb, c);
137}
138
133char *strlpart(char *txt, int maxlen) 139char *strlpart(char *txt, int maxlen)
134{ 140{
135 char *result; 141 char *result;