summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane2009-08-24 16:18:13 +0000
committerTom Lane2009-08-24 16:18:13 +0000
commitff638906164589e7b5b48dac01de59e18fba25b3 (patch)
treed187b9c7a221e815cd2f7845adb320572194ab27
parent0940a936ad744efb147597c506b5ef7333eebbb0 (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.h20
1 files changed, 13 insertions, 7 deletions
diff --git a/src/bin/psql/input.h b/src/bin/psql/input.h
index 06f1e35ccb..d2f8f40fe0 100644
--- a/src/bin/psql/input.h
+++ b/src/bin/psql/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"