This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] TUI: rewrite tui_query_hook()
- From: Eli Zaretskii <eliz at gnu dot org>
- To: Patrick Palka <patrick at parcs dot ath dot cx>
- Cc: gdb-patches at sourceware dot org, patrick at parcs dot ath dot cx
- Date: Thu, 08 Jan 2015 15:31:59 +0200
- Subject: Re: [PATCH] TUI: rewrite tui_query_hook()
- Authentication-results: sourceware.org; auth=none
- References: <1420689048-23538-1-git-send-email-patrick at parcs dot ath dot cx>
- Reply-to: Eli Zaretskii <eliz at gnu dot org>
> From: Patrick Palka <patrick@parcs.ath.cx>
> Cc: Patrick Palka <patrick@parcs.ath.cx>
> Date: Wed, 7 Jan 2015 22:50:48 -0500
>
> @@ -80,30 +80,18 @@ tui_query_hook (const char *msg, va_list argp)
> echo ();
> while (1)
> {
> - wrap_here (""); /* Flush any buffered output. */
> - gdb_flush (gdb_stdout);
> + char response[2], answer;
>
> - fputs_filtered (question, gdb_stdout);
> - printf_filtered (_("(y or n) "));
> + tui_puts (question);
> + tui_puts (_("(y or n) "));
>
> - wrap_here ("");
> - gdb_flush (gdb_stdout);
> -
> - answer = tui_getc (stdin);
> - clearerr (stdin); /* in case of C-d */
> - if (answer == EOF) /* C-d */
> + if (wgetnstr (win, response, 1) == ERR)
Given the latest discussions about buffering, don't you need to call
wrefresh after the second tui_puts?
Thanks.