From 85b9f3c71f703429e44290b76e6d9e87b58d31ce Mon Sep 17 00:00:00 2001 From: Aaron Gyes Date: Mon, 22 Aug 2022 13:30:51 -0700 Subject: [PATCH] Fix actual issue with allow_use_posix_spawn. We were testing the function pointer, not evaluating the function. This should be the proper fix. Thanks @ridiculousfish --- src/env_dispatch.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/env_dispatch.cpp b/src/env_dispatch.cpp index c7d4f6403..803371682 100644 --- a/src/env_dispatch.cpp +++ b/src/env_dispatch.cpp @@ -270,7 +270,7 @@ static constexpr bool allow_use_posix_spawn() { /// Whether to use posix_spawn when possible. static relaxed_atomic_bool_t g_use_posix_spawn{false}; -bool get_use_posix_spawn() { return allow_use_posix_spawn() && g_use_posix_spawn; } +bool get_use_posix_spawn() { return g_use_posix_spawn; } static void handle_fish_use_posix_spawn_change(const environment_t &vars) { // If the variable is missing or empty, we default to true if allowed. @@ -327,7 +327,7 @@ static std::unique_ptr create_dispatch_table() { var_dispatch_table->add(L"fish_history", handle_fish_history_change); var_dispatch_table->add(L"fish_autosuggestion_enabled", handle_autosuggestion_change); var_dispatch_table->add(L"TZ", handle_tz_change); - if (allow_use_posix_spawn) { + if (allow_use_posix_spawn()) { var_dispatch_table->add(L"fish_use_posix_spawn", handle_fish_use_posix_spawn_change); } var_dispatch_table->add(L"fish_trace", handle_fish_trace);