diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2009-08-24 16:18:13 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2009-08-24 16:18:13 +0000 |
commit | 9b708f1f57e8303677f40e7773a3aee716f18a8d (patch) | |
tree | 7fd688fa1ebf789d839d72fe089d2ae974ca89c9 /src | |
parent | 1e6bd556d8cc5346b38e7626b96edfab6ca0d544 (diff) | |
download | postgresql-9b708f1f57e8303677f40e7773a3aee716f18a8d.tar.gz postgresql-9b708f1f57e8303677f40e7773a3aee716f18a8d.zip |
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.
Diffstat (limited to 'src')
-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 73879c88b22..b2515c42f86 100644 --- a/src/bin/psql/input.h +++ b/src/bin/psql/input.h @@ -3,7 +3,7 @@ * * Copyright (c) 2000-2009, PostgreSQL Global Development Group * - * $PostgreSQL: pgsql/src/bin/psql/input.h,v 1.31 2009/01/01 17:23:55 momjian Exp $ + * $PostgreSQL: pgsql/src/bin/psql/input.h,v 1.32 2009/08/24 16:18:13 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 */ #include "pqexpbuffer.h" |