summary refs log tree commit diff
path: root/bin
diff options
context:
space:
mode:
authorJune McEnroe <june@causal.agency>2018-11-21 22:40:24 -0500
committerJune McEnroe <june@causal.agency>2018-11-21 22:40:24 -0500
commit914eae0db6f5ca7f5e5df508706e8c483abbd4eb (patch)
tree169250a6092cfccaa92279d65b5f97c556d04027 /bin
parentRead files in edi (diff)
downloadsrc-914eae0db6f5ca7f5e5df508706e8c483abbd4eb.tar.gz
src-914eae0db6f5ca7f5e5df508706e8c483abbd4eb.zip
Fix freeing empty buffer block
Diffstat (limited to 'bin')
-rw-r--r--bin/edi/buffer.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/bin/edi/buffer.c b/bin/edi/buffer.c
index 86575ad3..927e4e39 100644
--- a/bin/edi/buffer.c
+++ b/bin/edi/buffer.c
@@ -75,8 +75,9 @@ void bufferDelete(struct Buffer *buf) {
 wchar_t *bufferDest(struct Buffer *buf, size_t len) {
 	if (buf->len + len > buf->cap) {
 		if (!buf->len) {
+			struct Block *empty = buf->block;
 			buf->block = buf->block->prev;
-			free(buf->block);
+			free(empty);
 		}
 		while (len > buf->cap) buf->cap *= 2;
 		buf->block = blockAlloc(buf->block, buf->cap);
87289e46f38f2a2e18dc5778e4&follow=1'>Do basic match highlightingJune McEnroe 2022-06-02Clean up parsing a littleJune McEnroe 2022-06-02Don't duplicate path stringJune McEnroe 2022-06-02Use stderr instead of /dev/tty, realloc buffer if lines too longJune McEnroe For some reason I haven't been able to figure out, trying to poll /dev/tty returns POLLNVAL (and this was using 100% CPU looping), but using stderr instead works fine. 2022-06-02Add initial working version of qfJune McEnroe 2022-05-29Set prompt for okshJune McEnroe