summaryrefslogtreecommitdiff
path: root/src/bin/psql/input.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/bin/psql/input.c')
-rw-r--r--src/bin/psql/input.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/bin/psql/input.c b/src/bin/psql/input.c
index f5b0808e1ea..91fa5918249 100644
--- a/src/bin/psql/input.c
+++ b/src/bin/psql/input.c
@@ -3,7 +3,7 @@
*
* Copyright (c) 2000-2003, PostgreSQL Global Development Group
*
- * $Header: /cvsroot/pgsql/src/bin/psql/input.c,v 1.28 2003/08/04 23:59:40 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/bin/psql/input.c,v 1.28.2.1 2003/09/07 04:37:04 momjian Exp $
*/
#include "postgres_fe.h"
#include "input.h"
@@ -45,16 +45,6 @@ static void finishInput(int, void *);
#define PSQLHISTORY ".psql_history"
-#ifdef WIN32
-
- /*
- * translate DOS console character set into ANSI, needed e.g. for German
- * umlauts
- */
-if (GetVariableBool(pset.vars, "WIN32_CONSOLE"))
- OemToChar(s, s);
-#endif
-
#ifdef USE_READLINE
static enum histcontrol
GetHistControlConfig(void)
@@ -109,6 +99,15 @@ gets_interactive(const char *prompt)
else
s = gets_basic(prompt);
+#ifdef WIN32
+ /*
+ * translate DOS console character set into ANSI, needed e.g. for German
+ * umlauts
+ */
+ if (GetVariableBool(pset.vars, "WIN32_CONSOLE"))
+ OemToChar(s, s);
+#endif
+
if (useHistory && s && s[0])
{
enum histcontrol HC;
@@ -187,7 +186,8 @@ initializeInput(int flags)
initialize_readline();
useHistory = true;
- SetVariable(pset.vars, "HISTSIZE", "500");
+ if (GetVariable(pset.vars, "HISTSIZE") == NULL)
+ SetVariable(pset.vars, "HISTSIZE", "500");
using_history();
home = getenv("HOME");
if (home)