|
7 | 7 | * Portions Copyright (c) 1996-2006, PostgreSQL Global Development Group |
8 | 8 | * Portions Copyright (c) 1994, Regents of the University of California |
9 | 9 | * |
10 | | - * $PostgreSQL: pgsql/src/bin/scripts/common.c,v 1.22 2006/09/22 19:51:14 tgl Exp $ |
| 10 | + * $PostgreSQL: pgsql/src/bin/scripts/common.c,v 1.23 2006/10/03 21:45:20 momjian Exp $ |
11 | 11 | * |
12 | 12 | *------------------------------------------------------------------------- |
13 | 13 | */ |
@@ -208,20 +208,28 @@ yesno_prompt(const char *question) |
208 | 208 | { |
209 | 209 | char prompt[256]; |
210 | 210 |
|
| 211 | + /* translator: This is a question followed by the translated options for "yes" and "no". */ |
| 212 | + snprintf(prompt, sizeof(prompt), _("%s (%s/%s) "), |
| 213 | + _(question), _(PG_YESLETTER), _(PG_NOLETTER)); |
| 214 | + |
211 | 215 | for (;;) |
212 | 216 | { |
213 | 217 | char *resp; |
214 | 218 |
|
215 | | - /* translator: This is a question followed by the translated options for "yes" and "no". */ |
216 | | - snprintf(prompt, sizeof(prompt), _("%s (%s/%s) "), |
217 | | - _(question), _(PG_YESLETTER), _(PG_NOLETTER)); |
218 | 219 | resp = simple_prompt(prompt, 1, true); |
219 | 220 |
|
220 | 221 | if (strcmp(resp, _(PG_YESLETTER)) == 0) |
| 222 | + { |
| 223 | + free(resp); |
221 | 224 | return true; |
| 225 | + } |
222 | 226 | else if (strcmp(resp, _(PG_NOLETTER)) == 0) |
| 227 | + { |
| 228 | + free(resp); |
223 | 229 | return false; |
| 230 | + } |
224 | 231 |
|
| 232 | + free(resp); |
225 | 233 | printf(_("Please answer \"%s\" or \"%s\".\n"), |
226 | 234 | _(PG_YESLETTER), _(PG_NOLETTER)); |
227 | 235 | } |
|
0 commit comments