aboutsummaryrefslogtreecommitdiff
path: root/vendor/librune/lib/builder/u8strpushr.c
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/librune/lib/builder/u8strpushr.c')
-rw-r--r--vendor/librune/lib/builder/u8strpushr.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/vendor/librune/lib/builder/u8strpushr.c b/vendor/librune/lib/builder/u8strpushr.c
new file mode 100644
index 0000000..89bb64f
--- /dev/null
+++ b/vendor/librune/lib/builder/u8strpushr.c
@@ -0,0 +1,13 @@
+#include "builder.h"
+#include "utf8.h"
+
+#include "internal/common.h"
+
+struct u8buf *
+u8strpushr(struct u8buf *b, rune ch)
+{
+ if (!u8strgrow(b, b->len + u8wdth(ch)))
+ return nullptr;
+ b->len += rtou8(b->p + b->len, ch, b->cap - b->len);
+ return b;
+}