From 6e544f2fed8c26de14be55093ef66315977ef7d0 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Sun, 8 Sep 2024 21:42:42 +0900 Subject: [PATCH] Initialize goruby only when executing --- goruby.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/goruby.c b/goruby.c index 310bac5393..3ca96bfda0 100644 --- a/goruby.c +++ b/goruby.c @@ -60,7 +60,8 @@ int goruby_run_node(void *arg) { int state; - if (NIL_P(rb_protect(init_golf, Qtrue, &state))) { + if (ruby_executable_node(arg, NULL) && + NIL_P(rb_protect(init_golf, Qtrue, &state))) { return state == EXIT_SUCCESS ? EXIT_FAILURE : state; } return ruby_run_node(arg);