aboutsummaryrefslogtreecommitdiff
path: root/src/bin/psql/command.c
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2003-02-19 04:04:04 +0000
committerBruce Momjian <bruce@momjian.us>2003-02-19 04:04:04 +0000
commitadc3b34b9cc8a5aff7dd1cc9d249708490301ccb (patch)
treed49ee42828b0e2b86f673a390c3badee201f94c9 /src/bin/psql/command.c
parentd0f3a7e9c453b10ad3c16a780858dd2621fc184a (diff)
downloadpostgresql-adc3b34b9cc8a5aff7dd1cc9d249708490301ccb.tar.gz
postgresql-adc3b34b9cc8a5aff7dd1cc9d249708490301ccb.zip
Here's the patch I promised over on HACKERS - it alters the
implementation of '\e' history tracking for systems that have a readline compatability library without replace_history_entry. I fall back to pushing the query onto the history stack after the \e, rather than replacing it. The patch adds one more place to look for readline headers, and a test for replace_history_entry. I've only included the patch for configure.in Ross J. Reedstrom
Diffstat (limited to 'src/bin/psql/command.c')
-rw-r--r--src/bin/psql/command.c7
1 files changed, 6 insertions, 1 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);
}