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:
@ -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);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user