Commit 6d0efd3a authored by Tom Lane's avatar Tom Lane

Surely this temp buffer needn't be static.

parent cbb7acfa
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $PostgreSQL: pgsql/src/bin/scripts/common.c,v 1.21 2006/09/22 18:50:41 petere Exp $ * $PostgreSQL: pgsql/src/bin/scripts/common.c,v 1.22 2006/09/22 19:51:14 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -206,14 +206,15 @@ executeCommand(PGconn *conn, const char *query, ...@@ -206,14 +206,15 @@ executeCommand(PGconn *conn, const char *query,
bool bool
yesno_prompt(const char *question) yesno_prompt(const char *question)
{ {
static char prompt[128]; char prompt[256];
for (;;) for (;;)
{ {
char *resp; char *resp;
/* translator: This is a question followed by the translated options for "yes" and "no". */ /* translator: This is a question followed by the translated options for "yes" and "no". */
snprintf(prompt, sizeof(prompt), _("%s (%s/%s) "), _(question), _(PG_YESLETTER), _(PG_NOLETTER)); snprintf(prompt, sizeof(prompt), _("%s (%s/%s) "),
_(question), _(PG_YESLETTER), _(PG_NOLETTER));
resp = simple_prompt(prompt, 1, true); resp = simple_prompt(prompt, 1, true);
if (strcmp(resp, _(PG_YESLETTER)) == 0) if (strcmp(resp, _(PG_YESLETTER)) == 0)
...@@ -221,6 +222,7 @@ yesno_prompt(const char *question) ...@@ -221,6 +222,7 @@ yesno_prompt(const char *question)
else if (strcmp(resp, _(PG_NOLETTER)) == 0) else if (strcmp(resp, _(PG_NOLETTER)) == 0)
return false; return false;
printf(_("Please answer \"%s\" or \"%s\".\n"), _(PG_YESLETTER), _(PG_NOLETTER)); printf(_("Please answer \"%s\" or \"%s\".\n"),
_(PG_YESLETTER), _(PG_NOLETTER));
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment