Fix inclusions of readline/editline header files so that we only attempt to
authorTom Lane <tgl@sss.pgh.pa.us>
Mon, 24 Aug 2009 16:18:13 +0000 (16:18 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Mon, 24 Aug 2009 16:18:13 +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 06f1e35ccb351c87700067402660a3a79e0e394c..d2f8f40fe02ebdd8077df8bc1e11c5aa841b33df 100644 (file)
  */
 #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"