提交 ca9d5030 编写于 作者: B Bruce Momjian

For psql multi-line history, save backslash commands right away, rather

than only if there is already history.
上级 9c351695
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
* *
* Copyright (c) 2000-2006, PostgreSQL Global Development Group * Copyright (c) 2000-2006, PostgreSQL Global Development Group
* *
* $PostgreSQL: pgsql/src/bin/psql/mainloop.c,v 1.77 2006/06/05 14:47:38 momjian Exp $ * $PostgreSQL: pgsql/src/bin/psql/mainloop.c,v 1.78 2006/06/07 13:18:37 momjian Exp $
*/ */
#include "postgres_fe.h" #include "postgres_fe.h"
#include "mainloop.h" #include "mainloop.h"
...@@ -309,7 +309,7 @@ MainLoop(FILE *source) ...@@ -309,7 +309,7 @@ MainLoop(FILE *source)
if (!line_saved_in_history && pset.cur_cmd_interactive) if (!line_saved_in_history && pset.cur_cmd_interactive)
{ {
/* Sending a command (PSQL_CMD_SEND) zeros the length */ /* Sending a command (PSQL_CMD_SEND) zeros the length */
if (scan_result == PSCAN_BACKSLASH && history_buf->len != 0) if (scan_result == PSCAN_BACKSLASH)
pg_write_history(line); pg_write_history(line);
else else
pg_append_history(line, history_buf); pg_append_history(line, history_buf);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册