diff options
author | Tom Lane | 2009-08-24 16:18:49 +0000 |
---|---|---|
committer | Tom Lane | 2009-08-24 16:18:49 +0000 |
commit | deab233a9e8d1d395be4ee24ed7170af85f93187 (patch) | |
tree | ebaa102071df7498a78aa92565105ed8c948f4b9 | |
parent | 2e78dc85e0b3f0a65c58905a65279f6ab18da36e (diff) |
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.
-rw-r--r-- | src/bin/psql/input.h | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/src/bin/psql/input.h b/src/bin/psql/input.h index dfe9cf6ba41..a3bd2f75df3 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 <readline/readline.h> +#if defined(HAVE_READLINE_HISTORY_H) +#include <readline/history.h> +#endif + #elif defined(HAVE_EDITLINE_READLINE_H) #include <editline/readline.h> +#if defined(HAVE_EDITLINE_HISTORY_H) +#include <editline/history.h> +#endif + #elif defined(HAVE_READLINE_H) #include <readline.h> -#endif -#if defined(HAVE_READLINE_HISTORY_H) -#include <readline/history.h> -#elif defined(HAVE_EDITLINE_HISTORY_H) -#include <editline/history.h> -#elif defined(HAVE_HISTORY_H) +#if defined(HAVE_HISTORY_H) #include <history.h> #endif -#endif + +#endif /* HAVE_READLINE_READLINE_H, etc */ +#endif /* HAVE_LIBREADLINE */ char *gets_interactive(const char *prompt); |