diff options
Diffstat (limited to 'src/bin/psql/input.c')
-rw-r--r-- | src/bin/psql/input.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/src/bin/psql/input.c b/src/bin/psql/input.c index 241c5d356bb..fdf0bbecdd6 100644 --- a/src/bin/psql/input.c +++ b/src/bin/psql/input.c @@ -3,7 +3,7 @@ * * Copyright (c) 2000-2006, PostgreSQL Global Development Group * - * $PostgreSQL: pgsql/src/bin/psql/input.c,v 1.51 2006/03/05 15:58:51 momjian Exp $ + * $PostgreSQL: pgsql/src/bin/psql/input.c,v 1.52 2006/03/06 04:45:21 momjian Exp $ */ #include "postgres_fe.h" @@ -114,7 +114,7 @@ gets_interactive(const char *prompt) /* Put the line in the history buffer and also add the trailing \n */ void -pgadd_history(char *s, PQExpBuffer history_buf) +pg_append_history(char *s, PQExpBuffer history_buf) { #ifdef USE_READLINE @@ -134,12 +134,13 @@ pgadd_history(char *s, PQExpBuffer history_buf) } -/* Feed the contents of the history buffer to readline */ +/* + * Feed the string to readline + */ void -pgflush_history(PQExpBuffer history_buf) +pg_write_history(char *s) { -#ifdef USE_READLINE - char *s; +#ifdef USE_READLINE static char *prev_hist; int slen, i; @@ -147,7 +148,6 @@ pgflush_history(PQExpBuffer history_buf) { enum histcontrol HC; - s = history_buf->data; prev_hist = NULL; HC = GetHistControlConfig(); @@ -168,14 +168,12 @@ pgflush_history(PQExpBuffer history_buf) prev_hist = pg_strdup(s); add_history(s); } - - resetPQExpBuffer(history_buf); } #endif } void -pgclear_history(PQExpBuffer history_buf) +pg_clear_history(PQExpBuffer history_buf) { #ifdef USE_READLINE if (useReadline && useHistory) |