aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/bin/psql/command.c7
-rw-r--r--src/bin/psql/input.h6
-rw-r--r--src/include/pg_config.h.in11
3 files changed, 21 insertions, 3 deletions
diff --git a/src/bin/psql/command.c b/src/bin/psql/command.c
index 5b727b06bd5..0019755c0aa 100644
--- a/src/bin/psql/command.c
+++ b/src/bin/psql/command.c
@@ -3,7 +3,7 @@
*
* Copyright 2000-2002 by PostgreSQL Global Development Group
*
- * $Header: /cvsroot/pgsql/src/bin/psql/command.c,v 1.89 2003/02/13 04:08:16 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/bin/psql/command.c,v 1.90 2003/02/19 04:04:04 momjian Exp $
*/
#include "postgres_fe.h"
#include "command.h"
@@ -1649,7 +1649,12 @@ do_edit(const char *filename_arg, PQExpBuffer query_buf)
}
#ifdef USE_READLINE
+#ifdef HAVE_REPLACE_HISTORY_ENTRY
+
replace_history_entry(where_history(),query_buf->data,NULL);
+#else
+ add_history(query_buf->data);
+#endif
#endif
fclose(stream);
}
diff --git a/src/bin/psql/input.h b/src/bin/psql/input.h
index fbb52f20da3..4ed51f59cad 100644
--- a/src/bin/psql/input.h
+++ b/src/bin/psql/input.h
@@ -3,7 +3,7 @@
*
* Copyright 2000 by PostgreSQL Global Development Group
*
- * $Header: /cvsroot/pgsql/src/bin/psql/input.h,v 1.17 2002/09/04 20:31:36 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/bin/psql/input.h,v 1.18 2003/02/19 04:04:04 momjian Exp $
*/
#ifndef INPUT_H
#define INPUT_H
@@ -18,11 +18,15 @@
#define USE_READLINE 1
#if defined(HAVE_READLINE_READLINE_H)
#include <readline/readline.h>
+#elif defined(HAVE_EDITLINE_READLINE_H)
+#include <editline/readline.h>
#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)
#include <history.h>
#endif
diff --git a/src/include/pg_config.h.in b/src/include/pg_config.h.in
index 953fd4597b2..50960bdfd12 100644
--- a/src/include/pg_config.h.in
+++ b/src/include/pg_config.h.in
@@ -8,7 +8,7 @@
* or in pg_config.h afterwards. Of course, if you edit pg_config.h, then your
* changes will be overwritten the next time you run configure.
*
- * $Id: pg_config.h.in,v 1.39 2003/02/14 14:05:00 momjian Exp $
+ * $Id: pg_config.h.in,v 1.40 2003/02/19 04:04:04 momjian Exp $
*/
#ifndef PG_CONFIG_H
@@ -356,6 +356,12 @@
/* Set to 1 if you have <readline/readline.h> */
#undef HAVE_READLINE_READLINE_H
+/* Set to 1 if you have <editline/history.h> */
+#undef HAVE_EDITLINE_HISTORY_H
+
+/* Set to 1 if you have <editline/readline.h> */
+#undef HAVE_EDITLINE_READLINE_H
+
/* Set to 1 if you have <security/pam_appl.h> */
#undef HAVE_SECURITY_PAM_APPL_H
@@ -553,6 +559,9 @@
/* Set to 1 if you have rl_filename_completion_function */
#undef HAVE_RL_FILENAME_COMPLETION_FUNCTION
+/* Set to 1 if you have replace_history_entry */
+#undef HAVE_REPLACE_HISTORY_ENTRY
+
/* Set to 1 if you have getopt_long() (GNU long options) */
#undef HAVE_GETOPT_LONG