Ticket #4192: mc-4.8.26-clip-768285.patch

File mc-4.8.26-clip-768285.patch, 1.2 KB (added by slyfox, 3 years ago)

mc-4.8.26-clip-768285.patch

  • lib/tty/tty-ncurses.c

    https://bugs.gentoo.org/768285
    a b tty_clip (int *y, int *x, int *rows, int *cols) 
    135135        *rows += *y; 
    136136 
    137137        if (*rows <= 0) 
    138138            return FALSE; 
    139139 
    140140        *y = 0; 
    141141    } 
    142142 
    143143    if (*x < 0) 
    144144    { 
    145145        *cols += *x; 
    146146 
    147147        if (*cols <= 0) 
    148148            return FALSE; 
    149149 
    150150        *x = 0; 
    151151    } 
    152152 
    153153    if (*y + *rows > LINES) 
    154154        *rows = LINES - *y; 
     155    if (*rows <= 0) 
     156        return FALSE; 
    155157    if (*x + *cols > COLS) 
    156158        *cols = COLS - *x; 
     159    if (*cols <= 0) 
     160        return FALSE; 
    157161 
    158162    return TRUE; 
    159163} 
    160164 
    161165/* --------------------------------------------------------------------------------------------- */ 
    162166/*** public functions ****************************************************************************/ 
    163167/* --------------------------------------------------------------------------------------------- */ 
    164168 
    165169int 
    166170mc_tty_normalize_lines_char (const char *ch) 
    167171{ 
    168172    char *str2; 
    169173    int res; 
    170174 
    171175    struct mc_tty_lines_struct 
    172176    { 
    173177        const char *line; 
    174178        int line_code; 
    175179    } const lines_codes[] = { 
    176180        {"\342\224\230", ACS_LRCORNER}, /* ┌ */