From e1db3027afa366a8498dd5863f8db7d24b8fc237 Mon Sep 17 00:00:00 2001 From: Sean Bright Date: Mon, 27 May 2024 09:43:12 -0400 Subject: [PATCH] asterisk.c: Don't log an error if .asterisk_history does not exist. Fixes #751 --- main/asterisk.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/main/asterisk.c b/main/asterisk.c index e0a37ea6cf..78fc4e33fd 100644 --- a/main/asterisk.c +++ b/main/asterisk.c @@ -3182,7 +3182,12 @@ static int ast_el_read_history(const char *filename) ast_el_initialize(); } - return history(el_hist, &ev, H_LOAD, filename); + if (access(filename, F_OK) == 0) { + return history(el_hist, &ev, H_LOAD, filename); + } + + /* If the history file doesn't exist, failing to read it is unremarkable. */ + return 0; } static void process_histfile(int (*readwrite)(const char *filename))