From 2ec3b7348bc051b947e7b1fcdd7bdee02f92b9c6 Mon Sep 17 00:00:00 2001 From: Allen Webster Date: Fri, 4 Nov 2016 23:55:07 -0400 Subject: [PATCH] fixed file saving bug --- 4ed_api_implementation.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/4ed_api_implementation.cpp b/4ed_api_implementation.cpp index 20bae7c8..1ad8db02 100644 --- a/4ed_api_implementation.cpp +++ b/4ed_api_implementation.cpp @@ -1143,14 +1143,16 @@ DOC_RETURN(This call returns non-zero on success.) Editing_File *file = imp_get_file(cmd, buffer); if (file){ + if (file_get_sync(file) != DirtyState_UpToDate){ result = true; Partition *part = &models->mem.part; Temp_Memory temp = begin_temp_memory(part); String name = make_string_terminated(part, filename, filename_len); - save_file_to_name(system, &models->mem, file, name.str); - end_temp_memory(temp); - } + save_file_to_name(system, &models->mem, file, name.str); + end_temp_memory(temp); + } + } return(result); }