diff options
Diffstat (limited to 'src/bin/psql/prompt.c')
-rw-r--r-- | src/bin/psql/prompt.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/src/bin/psql/prompt.c b/src/bin/psql/prompt.c index 981e8b6b58e..6bf86d1108c 100644 --- a/src/bin/psql/prompt.c +++ b/src/bin/psql/prompt.c @@ -3,7 +3,7 @@ * * Copyright (c) 2000-2006, PostgreSQL Global Development Group * - * $PostgreSQL: pgsql/src/bin/psql/prompt.c,v 1.47 2006/07/15 03:35:21 tgl Exp $ + * $PostgreSQL: pgsql/src/bin/psql/prompt.c,v 1.48 2006/08/29 15:19:51 tgl Exp $ */ #include "postgres_fe.h" @@ -72,12 +72,11 @@ get_prompt(promptStatus_t status) bool esc = false; const char *p; const char *prompt_string = "? "; - const char *prompt_name = NULL; switch (status) { case PROMPT_READY: - prompt_name = "PROMPT1"; + prompt_string = pset.prompt1; break; case PROMPT_CONTINUE: @@ -86,21 +85,18 @@ get_prompt(promptStatus_t status) case PROMPT_DOLLARQUOTE: case PROMPT_COMMENT: case PROMPT_PAREN: - prompt_name = "PROMPT2"; + prompt_string = pset.prompt2; break; case PROMPT_COPY: - prompt_name = "PROMPT3"; + prompt_string = pset.prompt3; break; } - if (prompt_name) - prompt_string = GetVariable(pset.vars, prompt_name); - destination[0] = '\0'; for (p = prompt_string; - p && *p && strlen(destination) < MAX_PROMPT_SIZE; + *p && strlen(destination) < MAX_PROMPT_SIZE; p++) { memset(buf, 0, MAX_PROMPT_SIZE + 1); @@ -182,7 +178,7 @@ get_prompt(promptStatus_t status) case PROMPT_READY: if (!pset.db) buf[0] = '!'; - else if (!GetVariableBool(pset.vars, "SINGLELINE")) + else if (!pset.singleline) buf[0] = '='; else buf[0] = '^'; |