From 8843f2d2a9e0f9ac43b5d9ee84312186b2c591ca Mon Sep 17 00:00:00 2001 From: Max Wash Date: Sun, 31 May 2026 17:34:28 +0100 Subject: [PATCH] frontend: print an error message when the specified script file cannot be opened --- bshell/main.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/bshell/main.c b/bshell/main.c index 483b21f..3985572 100644 --- a/bshell/main.c +++ b/bshell/main.c @@ -77,6 +77,15 @@ int main(int argc, const char **argv) status = bshell_file_open(argv[1], &file); linesrc = &file->f_base; interactive = false; + + if (!FX_OK(status)) { + fprintf(stderr, + "%s: cannot open '%s': %s\n", + argv[0], + argv[1], + bshell_status_get_description(status)); + return -1; + } } else { #if BSHELL_INTERACTIVE == 1 ed = line_ed_create();