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