aboutsummaryrefslogtreecommitdiff
path: root/buffer.c
diff options
context:
space:
mode:
Diffstat (limited to 'buffer.c')
-rw-r--r--buffer.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/buffer.c b/buffer.c
index bc77f7f..1304098 100644
--- a/buffer.c
+++ b/buffer.c
@@ -168,3 +168,10 @@ const char *buffer_content0(Buffer *buf) {
return "";
return buf->data;
}
+
+char *buffer_move(Buffer *buf) {
+ char *data = buf->data;
+ buffer_clear(buf);
+ buf->data = NULL;
+ return data;
+}