Fix inclusions of readline/editline header files so that we only attempt to
authorTom Lane <[email protected]>
Mon, 24 Aug 2009 16:18:49 +0000 (16:18 +0000)
committerTom Lane <[email protected]>
Mon, 24 Aug 2009 16:18:49 +0000 (16:18 +0000)
#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.

src/bin/psql/input.h

index dfe9cf6ba41852f007831ac93adafa5388378f34..a3bd2f75df37eeb199182c2ac6f1cd494f4220f1 100644 (file)
@@ -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
  */
 #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);