1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-29 10:41:53 +03:00

Code review for psql multiline history patch(es). Fix memory leak,

failure to enter commands in history if canceled by control-C, other
infelicities.
This commit is contained in:
Tom Lane
2006-06-11 23:06:00 +00:00
parent bf64a37909
commit e2e2a9db4c
7 changed files with 138 additions and 167 deletions

View File

@ -3,7 +3,7 @@
*
* Copyright (c) 2000-2006, PostgreSQL Global Development Group
*
* $PostgreSQL: pgsql/src/bin/psql/command.c,v 1.169 2006/06/07 22:24:45 momjian Exp $
* $PostgreSQL: pgsql/src/bin/psql/command.c,v 1.170 2006/06/11 23:06:00 tgl Exp $
*/
#include "postgres_fe.h"
#include "command.h"
@ -1361,7 +1361,7 @@ do_edit(const char *filename_arg, PQExpBuffer query_buf)
}
else
{
/* read file back in */
/* read file back into query_buf */
char line[1024];
resetPQExpBuffer(query_buf);
@ -1374,14 +1374,6 @@ do_edit(const char *filename_arg, PQExpBuffer query_buf)
error = true;
}
#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);
}