From d4786851ffa0265f534ce66f337be2c15f2358a2 Mon Sep 17 00:00:00 2001 From: sanine Date: Fri, 24 Mar 2023 17:15:58 -0500 Subject: do chdir error checking --- src/main.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') diff --git a/src/main.c b/src/main.c index 95eef75..357a04f 100644 --- a/src/main.c +++ b/src/main.c @@ -12,6 +12,7 @@ #else # include #endif +#include void print_load_error(lua_State *L, const char *script_file, int error_type); @@ -29,6 +30,10 @@ int main(int argc, char **argv) /* configure working directory */ if (options.working_dir != NULL) { chdir(options.working_dir); + if (errno == ENOENT) { + honey_log(HONEY_FATAL, "[FATAL] could not find directory \"%s\"\n", options.working_dir); + return 1; + } } /* set up lua state */ -- cgit v1.2.1