2012-05-24 Pedro Alves <palves@redhat.com>
PR tui/14159 * tui/tui-hooks.c (tui_query_hook): Pre-compute the question string, instead of reusing the va_list argument.
This commit is contained in:
parent
16224acd5c
commit
b09846a918
|
@ -1,3 +1,10 @@
|
||||||
|
2012-05-24 Pedro Alves <palves@redhat.com>
|
||||||
|
|
||||||
|
PR tui/14159
|
||||||
|
|
||||||
|
* tui/tui-hooks.c (tui_query_hook): Pre-compute the question
|
||||||
|
string, instead of reusing the va_list argument.
|
||||||
|
|
||||||
2012-05-24 Tom Tromey <tromey@redhat.com>
|
2012-05-24 Tom Tromey <tromey@redhat.com>
|
||||||
|
|
||||||
* cp-support.h (cp_finalize_namespace, cp_initialize_namespace):
|
* cp-support.h (cp_finalize_namespace, cp_initialize_namespace):
|
||||||
|
|
|
@ -69,6 +69,13 @@ tui_query_hook (const char *msg, va_list argp)
|
||||||
int retval;
|
int retval;
|
||||||
int ans2;
|
int ans2;
|
||||||
int answer;
|
int answer;
|
||||||
|
char *question;
|
||||||
|
struct cleanup *old_chain;
|
||||||
|
|
||||||
|
/* Format the question outside of the loop, to avoid reusing
|
||||||
|
ARGP. */
|
||||||
|
question = xstrvprintf (msg, argp);
|
||||||
|
old_chain = make_cleanup (xfree, question);
|
||||||
|
|
||||||
echo ();
|
echo ();
|
||||||
while (1)
|
while (1)
|
||||||
|
@ -76,7 +83,7 @@ tui_query_hook (const char *msg, va_list argp)
|
||||||
wrap_here (""); /* Flush any buffered output. */
|
wrap_here (""); /* Flush any buffered output. */
|
||||||
gdb_flush (gdb_stdout);
|
gdb_flush (gdb_stdout);
|
||||||
|
|
||||||
vfprintf_filtered (gdb_stdout, msg, argp);
|
fputs_filtered (question, gdb_stdout);
|
||||||
printf_filtered (_("(y or n) "));
|
printf_filtered (_("(y or n) "));
|
||||||
|
|
||||||
wrap_here ("");
|
wrap_here ("");
|
||||||
|
@ -113,6 +120,8 @@ tui_query_hook (const char *msg, va_list argp)
|
||||||
printf_filtered (_("Please answer y or n.\n"));
|
printf_filtered (_("Please answer y or n.\n"));
|
||||||
}
|
}
|
||||||
noecho ();
|
noecho ();
|
||||||
|
|
||||||
|
do_cleanups (old_chain);
|
||||||
return retval;
|
return retval;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue