summaryrefslogtreecommitdiffstats
path: root/buffer.c
diff options
context:
space:
mode:
authorKevin McCarthy <kevin@8t8.us>2019-09-19 18:52:24 -0700
committerKevin McCarthy <kevin@8t8.us>2019-09-19 19:14:03 -0700
commit192a6d0ebe7d303b5a340a5334ada58bd5e509a6 (patch)
treee4deaa91bcb4cea9065460fbb1fae14bbd002c74 /buffer.c
parenta4b53e19ef471efc1938348d1623b811354f1c93 (diff)
Convert mutt_complete() to use the buffer pool.
Add helper functions mutt_buffer_substrcpy() and mutt_buffer_concatn_path(). Remove mutt_concatn_path() because mutt_complete() was the only caller.
Diffstat (limited to 'buffer.c')
-rw-r--r--buffer.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/buffer.c b/buffer.c
index c527de92..c15c30db 100644
--- a/buffer.c
+++ b/buffer.c
@@ -208,6 +208,12 @@ void mutt_buffer_strcpy_n (BUFFER *buf, const char *s, size_t len)
mutt_buffer_addstr_n (buf, s, len);
}
+void mutt_buffer_substrcpy (BUFFER *buf, const char *beg, const char *end)
+{
+ mutt_buffer_clear (buf);
+ if (end > beg)
+ mutt_buffer_strcpy_n (buf, beg, end - beg);
+}
static void increase_buffer_pool (void)
{