From: Tom Lane Date: Mon, 24 Aug 2009 16:18:49 +0000 (+0000) Subject: Fix inclusions of readline/editline header files so that we only attempt to X-Git-Tag: REL7_4_26~6 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=deab233a9e8d1d395be4ee24ed7170af85f93187;p=postgresql Fix inclusions of readline/editline header files so that we only attempt to #include the version of history.h that is in the same directory as the readline.h we are using. This avoids problems in some scenarios where both readline and editline are installed. Report and patch by Zdenek Kotala. --- diff --git a/src/bin/psql/input.h b/src/bin/psql/input.h index dfe9cf6ba4..a3bd2f75df 100644 --- a/src/bin/psql/input.h +++ b/src/bin/psql/input.h @@ -3,7 +3,7 @@ * * Copyright (c) 2000-2003, PostgreSQL Global Development Group * - * $Header: /cvsroot/pgsql/src/bin/psql/input.h,v 1.20 2003/08/04 23:59:40 tgl Exp $ + * $Header: /cvsroot/pgsql/src/bin/psql/input.h,v 1.20.4.1 2009/08/24 16:18:49 tgl Exp $ */ #ifndef INPUT_H #define INPUT_H @@ -16,21 +16,27 @@ */ #ifdef HAVE_LIBREADLINE #define USE_READLINE 1 + #if defined(HAVE_READLINE_READLINE_H) #include +#if defined(HAVE_READLINE_HISTORY_H) +#include +#endif + #elif defined(HAVE_EDITLINE_READLINE_H) #include +#if defined(HAVE_EDITLINE_HISTORY_H) +#include +#endif + #elif defined(HAVE_READLINE_H) #include -#endif -#if defined(HAVE_READLINE_HISTORY_H) -#include -#elif defined(HAVE_EDITLINE_HISTORY_H) -#include -#elif defined(HAVE_HISTORY_H) +#if defined(HAVE_HISTORY_H) #include #endif -#endif + +#endif /* HAVE_READLINE_READLINE_H, etc */ +#endif /* HAVE_LIBREADLINE */ char *gets_interactive(const char *prompt);