]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
dnsdist: Keep 'help' working even when libedit has been disabled 11317/head
authorRemi Gacogne <remi.gacogne@powerdns.com>
Fri, 11 Feb 2022 16:18:56 +0000 (17:18 +0100)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Fri, 11 Feb 2022 16:18:56 +0000 (17:18 +0100)
pdns/dnsdist-console.cc

index bd1b1b356e5cefa9fb39cc72c12357fe39e57b7e..5d66c21bcfa1290e0ebb9e846fb5b2295708f8ca 100644 (file)
@@ -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<ConsoleKeyword> g_consoleKeywords{
   /* keyword, function, parameters, description */
@@ -769,6 +769,7 @@ const std::vector<ConsoleKeyword> 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)