From 74f4ec2a181a28a3b787cee0dc8e9ea74f50a8f8 Mon Sep 17 00:00:00 2001 From: Albert Cervin Date: Thu, 11 May 2023 22:23:53 +0200 Subject: Fix write to file when no changes A change of which file to write to was not considered a "change", thus not actually writing the file to disk since it was already "saved". --- src/dged/buffer.c | 1 + src/main/main.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/dged/buffer.c b/src/dged/buffer.c index c34d314..7e9789a 100644 --- a/src/dged/buffer.c +++ b/src/dged/buffer.c @@ -606,6 +606,7 @@ void buffer_to_file(struct buffer *buffer) { void buffer_write_to(struct buffer *buffer, const char *filename) { buffer->filename = to_abspath(filename); + buffer->modified = true; buffer_to_file(buffer); } diff --git a/src/main/main.c b/src/main/main.c index 59a9a59..b14c6c0 100644 --- a/src/main/main.c +++ b/src/main/main.c @@ -20,7 +20,7 @@ #include "bindings.h" #include "cmds.h" -struct frame_allocator frame_allocator; +static struct frame_allocator frame_allocator; void *frame_alloc(size_t sz) { return frame_allocator_alloc(&frame_allocator, sz); -- cgit v1.2.3