lkml.org 
[lkml]   [2012]   [Jul]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 1/6] menuconfig: Remove superfluous conditionnal
    Date
    Because end_reached is set to 0 before the loop, the test "!end_reached" is
    always true and can be removed. This structure was perhaps copied from the
    similar one in back_lines().

    Signed-off-by: Benjamin Poirier <bpoirier@suse.de>
    ---
    scripts/kconfig/lxdialog/textbox.c | 8 +++-----
    1 files changed, 3 insertions(+), 5 deletions(-)

    diff --git a/scripts/kconfig/lxdialog/textbox.c b/scripts/kconfig/lxdialog/textbox.c
    index 4e5de60..264a2b9 100644
    --- a/scripts/kconfig/lxdialog/textbox.c
    +++ b/scripts/kconfig/lxdialog/textbox.c
    @@ -357,10 +357,8 @@ static char *get_line(void)
    end_reached = 0;
    while (*page != '\n') {
    if (*page == '\0') {
    - if (!end_reached) {
    - end_reached = 1;
    - break;
    - }
    + end_reached = 1;
    + break;
    } else if (i < MAX_LEN)
    line[i++] = *(page++);
    else {
    @@ -373,7 +371,7 @@ static char *get_line(void)
    if (i <= MAX_LEN)
    line[i] = '\0';
    if (!end_reached)
    - page++; /* move pass '\n' */
    + page++; /* move past '\n' */

    return line;
    }
    --
    1.7.7


    \
     
     \ /
      Last update: 2012-07-30 22:01    [W:0.022 / U:29.816 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site