From: Remi Gacogne Date: Fri, 11 Feb 2022 16:18:56 +0000 (+0100) Subject: dnsdist: Keep 'help' working even when libedit has been disabled X-Git-Tag: auth-4.7.0-alpha1~7^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F11317%2Fhead;p=thirdparty%2Fpdns.git dnsdist: Keep 'help' working even when libedit has been disabled --- 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)