https://bugs.gentoo.org/768285
a
|
b
|
tty_clip (int *y, int *x, int *rows, int *cols) |
135 | 135 | *rows += *y; |
136 | 136 | |
137 | 137 | if (*rows <= 0) |
138 | 138 | return FALSE; |
139 | 139 | |
140 | 140 | *y = 0; |
141 | 141 | } |
142 | 142 | |
143 | 143 | if (*x < 0) |
144 | 144 | { |
145 | 145 | *cols += *x; |
146 | 146 | |
147 | 147 | if (*cols <= 0) |
148 | 148 | return FALSE; |
149 | 149 | |
150 | 150 | *x = 0; |
151 | 151 | } |
152 | 152 | |
153 | 153 | if (*y + *rows > LINES) |
154 | 154 | *rows = LINES - *y; |
| 155 | if (*rows <= 0) |
| 156 | return FALSE; |
155 | 157 | if (*x + *cols > COLS) |
156 | 158 | *cols = COLS - *x; |
| 159 | if (*cols <= 0) |
| 160 | return FALSE; |
157 | 161 | |
158 | 162 | return TRUE; |
159 | 163 | } |
160 | 164 | |
161 | 165 | /* --------------------------------------------------------------------------------------------- */ |
162 | 166 | /*** public functions ****************************************************************************/ |
163 | 167 | /* --------------------------------------------------------------------------------------------- */ |
164 | 168 | |
165 | 169 | int |
166 | 170 | mc_tty_normalize_lines_char (const char *ch) |
167 | 171 | { |
168 | 172 | char *str2; |
169 | 173 | int res; |
170 | 174 | |
171 | 175 | struct mc_tty_lines_struct |
172 | 176 | { |
173 | 177 | const char *line; |
174 | 178 | int line_code; |
175 | 179 | } const lines_codes[] = { |
176 | 180 | {"\342\224\230", ACS_LRCORNER}, /* ┌ */ |