From b83e6287baf7250c11525a7ac0ab3818771a611e Mon Sep 17 00:00:00 2001 From: Remi Gacogne Date: Fri, 11 Feb 2022 17:18:56 +0100 Subject: [PATCH] dnsdist: Keep 'help' working even when libedit has been disabled --- pdns/dnsdist-console.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pdns/dnsdist-console.cc b/pdns/dnsdist-console.cc index bd1b1b356e..5d66c21bcf 100644 --- a/pdns/dnsdist-console.cc +++ b/pdns/dnsdist-console.cc @@ -447,7 +447,7 @@ void doConsole() } } -#if defined(HAVE_LIBEDIT) and not defined(DISABLE_COMPLETION) +#ifndef DISABLE_COMPLETION /**** CARGO CULT CODE AHEAD ****/ const std::vector g_consoleKeywords{ /* keyword, function, parameters, description */ @@ -769,6 +769,7 @@ const std::vector g_consoleKeywords{ { "wrandom", false, "", "Weighted random over available servers, based on the server 'weight' parameter" }, }; +#if defined(HAVE_LIBEDIT) extern "C" { static char* my_generator(const char* text, int state) { @@ -808,6 +809,7 @@ char** my_completion( const char * text , int start, int end) return matches; } } +#endif /* HAVE_LIBEDIT */ #endif /* DISABLE_COMPLETION */ static void controlClientThread(ConsoleConnection&& conn) -- 2.47.2