--- lbbs/src/main.c 2025/11/18 15:15:18 1.81 +++ lbbs/src/main.c 2025/11/19 14:47:08 1.84 @@ -142,13 +142,6 @@ int main(int argc, char *argv[]) fprintf(stderr, "chdir(..) error: %d\n", errno); return -1; } -#ifdef __CYGWIN__ - if (chdir("..") < 0) - { - fprintf(stderr, "chdir(..) error: %d\n", errno); - return -1; - } -#endif // Apply the specified locale if (setlocale(LC_ALL, "en_US.UTF-8") == NULL) @@ -253,22 +246,17 @@ int main(int argc, char *argv[]) // Load menus if (load_menu(&bbs_menu, CONF_MENU) < 0) { - log_error("load_menu(%s) error\n", CONF_MENU); + log_error("load_menu(bbs_menu) error\n"); goto cleanup; } if (load_menu(&top10_menu, CONF_TOP10_MENU) < 0) { - log_error("load_menu(%s) error\n", CONF_TOP10_MENU); + log_error("load_menu(top10_menu) error\n"); goto cleanup; } top10_menu.allow_exit = 1; // Load data files - if (file_loader_init() < 0) - { - log_error("file_loader_init() error\n"); - goto cleanup; - } for (int i = 0; i < data_files_load_startup_count; i++) { if (load_file(data_files_load_startup[i]) < 0) @@ -391,7 +379,13 @@ cleanup: } // Cleanup loaded data files - file_loader_cleanup(); + for (int i = 0; i < data_files_load_startup_count; i++) + { + if (unload_file(data_files_load_startup[i]) < 0) + { + log_error("unload_file(%s) error\n", data_files_load_startup[i]); + } + } // Cleanup menu unload_menu(&bbs_menu);