aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2009-08-24 16:18:30 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2009-08-24 16:18:30 +0000
commite282dacb407e7a3fff8188bc3b2c7f5c792f4bd7 (patch)
tree2271e1207ea897de32a850defa210ad288301bca /src
parent0302a8eaa7ac28099b0365d3d28c31771ad48f28 (diff)
downloadpostgresql-e282dacb407e7a3fff8188bc3b2c7f5c792f4bd7.tar.gz
postgresql-e282dacb407e7a3fff8188bc3b2c7f5c792f4bd7.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.h22
1 files changed, 14 insertions, 8 deletions
diff --git a/src/bin/psql/input.h b/src/bin/psql/input.h
index 0c6ede0cd5a..e5a597beb66 100644
--- a/src/bin/psql/input.h
+++ b/src/bin/psql/input.h
@@ -3,7 +3,7 @@
*
* Copyright (c) 2000-2006, PostgreSQL Global Development Group
*
- * $PostgreSQL: pgsql/src/bin/psql/input.h,v 1.28 2006/06/11 23:06:00 tgl Exp $
+ * $PostgreSQL: pgsql/src/bin/psql/input.h,v 1.28.2.1 2009/08/24 16:18:30 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"