From f01d630b6d2ac0b3c5687067ea2df1b7ec14c91d Mon Sep 17 00:00:00 2001 From: Allen Webster Date: Mon, 29 Feb 2016 00:01:31 -0500 Subject: [PATCH] a3.4.4 another fix --- 4ed_file.cpp | 7 ++++++- win32_4ed.cpp | 10 +++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/4ed_file.cpp b/4ed_file.cpp index bed5e548..7a909297 100644 --- a/4ed_file.cpp +++ b/4ed_file.cpp @@ -310,7 +310,12 @@ hot_directory_set(System_Functions *system, Hot_Directory *hot_directory, b32 success = copy_checked(&hot_directory->string, str); terminate_with_null(&hot_directory->string); if (success){ - system->set_file_list(&hot_directory->file_list, str); + if (str.size > 0){ + system->set_file_list(&hot_directory->file_list, str); + } + else{ + system->set_file_list(&hot_directory->file_list, make_string((char*)1, 0)); + } } hot_directory_fixup(hot_directory, working_set); } diff --git a/win32_4ed.cpp b/win32_4ed.cpp index d303e19c..295354e4 100644 --- a/win32_4ed.cpp +++ b/win32_4ed.cpp @@ -450,9 +450,13 @@ Sys_Set_File_List_Sig(system_set_file_list){ } } else{ - Win32FreeMemory(file_list->block); - file_list->block = 0; - file_list->block_size = 0; + if (directory.str == 0){ + Win32FreeMemory(file_list->block); + file_list->block = 0; + file_list->block_size = 0; + } + file_list->infos = 0; + file_list->count = 0; } }