From: "Yann E. MORIN" <yann.morin.1998@free.fr>
To: Dirk Gouders <dirk@gouders.net>
Cc: linux-kbuild@vger.kernel.org
Subject: Re: [RFC] mconf: make extensive use of ncurses' variables LINES and COLS.
Date: Sat, 11 May 2013 22:58:02 +0200 [thread overview]
Message-ID: <20130511205802.GD3222@free.fr> (raw)
In-Reply-To: <ghsj1t7o47.fsf@mx10.gouders.net>
Dirk, All,
On 2013-05-11 13:27 +0200, Dirk Gouders spake thusly:
> Dirk Gouders <dirk@gouders.net> writes:
[--SNIP--]
> From a8f5ff2e666d467c84ece16e1fe783ac89ceaa60 Mon Sep 17 00:00:00 2001
> From: Dirk Gouders <dirk@gouders.net>
> Date: Sat, 11 May 2013 12:46:12 +0200
> Subject: [PATCH v3] mconf: Use ncurses' variables LINES and COLS according to the
> documentation.
>
> According to the documentation [1], LINES and COLS are initialized by
> initscr(). So, use these variables in init_dialog().
>
> The documentation does not say anything about the behavior when
> windows are resized. Do not rely on the current implementation
> of ncurses that updates these variables on resize, but use the propper
> function calls to get window dimensions.
You missed three occurences of COLS in:
scripts/kconfig/lxdialog/util.c:dialog_clear
> diff --git a/scripts/kconfig/lxdialog/util.c b/scripts/kconfig/lxdialog/util.c
> index a0e97c2..9b528a2 100644
> --- a/scripts/kconfig/lxdialog/util.c
> +++ b/scripts/kconfig/lxdialog/util.c
> @@ -309,15 +309,12 @@ void dialog_clear(void)
> */
> int init_dialog(const char *backtitle)
> {
> - int height, width;
> -
> initscr(); /* Init curses */
>
> /* Get current cursor position for signal handler in mconf.c */
> getyx(stdscr, saved_y, saved_x);
>
> - getmaxyx(stdscr, height, width);
> - if (height < 19 || width < 80) {
> + if (LINES < 19 || COLS < 80) {
I know that COLS and LINES are correct right here since we just called
initscr, but for the sake of consistency, I think we'd better use the
functions here, too.
Also, it's a pain to apply your patches, since 'git am' will use the
entire body of the mail as the commit message.
I know you have issues using 'git send-email', but could you please at
least add a scissor-line as the last line of your email body, which will
make 'git am' ignore whatever is above that line (and that line itself):
---8<--- <- This is a scissor-line
And please do not attach the patch, add it in the body of the mail.
Use 'git format-patch' to prepare your patch(es), and just send the
resulting file(s) as the mail (hopefully, gnus is able to use an
existing file as the mail to send).
Otherwise, LGTM.
Regards,
Yann E. MORIN.
--
.-----------------.--------------------.------------------.--------------------.
| Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ |
| +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. |
'------------------------------^-------^------------------^--------------------'
next prev parent reply other threads:[~2013-05-11 20:58 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-10 12:59 [RFC] mconf: make extensive use of ncurses' variables LINES and COLS Dirk Gouders
2013-05-11 9:48 ` Yann E. MORIN
2013-05-11 11:20 ` Dirk Gouders
2013-05-11 11:27 ` Dirk Gouders
2013-05-11 20:58 ` Yann E. MORIN [this message]
2013-05-12 10:30 ` [PATCH v4] mconf: use function calls instead " Dirk Gouders
2013-05-12 12:55 ` Yann E. MORIN
2013-05-12 13:41 ` Dirk Gouders
2013-05-12 14:22 ` Yann E. MORIN
2013-05-13 9:23 ` [PATCH] nconf: " Dirk Gouders
2013-05-13 16:39 ` Yann E. MORIN
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130511205802.GD3222@free.fr \
--to=yann.morin.1998@free.fr \
--cc=dirk@gouders.net \
--cc=linux-kbuild@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox