From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wg0-f54.google.com ([74.125.82.54]:36012 "EHLO mail-wg0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751982Ab3EMQkE (ORCPT ); Mon, 13 May 2013 12:40:04 -0400 Received: by mail-wg0-f54.google.com with SMTP id x12so6762991wgg.9 for ; Mon, 13 May 2013 09:40:02 -0700 (PDT) Date: Mon, 13 May 2013 18:39:56 +0200 From: "Yann E. MORIN" Subject: Re: [PATCH] nconf: use function calls instead of ncurses' variables LINES and COLS Message-ID: <20130513163956.GA17848@free.fr> References: <20130512142218.GB2976@free.fr> <1368437038-30444-1-git-send-email-dirk@gouders.net> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <1368437038-30444-1-git-send-email-dirk@gouders.net> Sender: linux-kbuild-owner@vger.kernel.org List-ID: To: Dirk Gouders Cc: linux-kbuild@vger.kernel.org Dirk, All, On 2013-05-13 11:23 +0200, Dirk Gouders spake thusly: > According to the documentation [1], LINES and COLS are initialized by > initscr(); it 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 or macros > to get window dimensions. > > The use of the variables in main() was OK, but for the sake of > consistency it was modified to use the macro getmaxyx(). > > [1] ncurses(3X) > > Signed-off-by: Dirk Gouders Queued in my tree, with two very, very light changes: > diff --git a/scripts/kconfig/nconf.c b/scripts/kconfig/nconf.c > index dbf31ed..55fe5a6 100644 > --- a/scripts/kconfig/nconf.c > +++ b/scripts/kconfig/nconf.c [--SMIP--] > @@ -1455,14 +1456,19 @@ static void conf_save(void) > > void setup_windows(void) > { > + int lines; > + int columns; I've chamged this to be a single line: int lines, columns; [--SNIP--] > @@ -1470,6 +1476,8 @@ void setup_windows(void) > > int main(int ac, char **av) > { > + int lines; > + int columns; Ditto. Thank you! 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. | '------------------------------^-------^------------------^--------------------'