Xinqi Bao's Git
projects
/
st.git
/ commitdiff
summary
|
log
|
commit
|
diff
|
tree
raw
|
patch
|
inline
| side by side (parent:
39ae1a4
)
Remove 'slide' variable in tresize.
author
[email protected]
<
[email protected]
>
Sat, 11 Apr 2015 17:30:36 +0000
(19:30 +0200)
committer
Roberto E. Vargas Caballero <
[email protected]
>
Mon, 13 Apr 2015 08:18:08 +0000
(10:18 +0200)
st.c
patch
|
blob
|
history
diff --git
a/st.c
b/st.c
index
79bf1c8
..
2c58a3e
100644
(file)
--- a/
st.c
+++ b/
st.c
@@
-2769,7
+2769,6
@@
tresize(int col, int row) {
int i;
int minrow = MIN(row, term.row);
int mincol = MIN(col, term.col);
int i;
int minrow = MIN(row, term.row);
int mincol = MIN(col, term.col);
- int slide = term.c.y - row + 1;
bool *bp;
TCursor c;
bool *bp;
TCursor c;
@@
-2784,13
+2783,13
@@
tresize(int col, int row) {
* tscrollup would work here, but we can optimize to
* memmove because we're freeing the earlier lines
*/
* tscrollup would work here, but we can optimize to
* memmove because we're freeing the earlier lines
*/
- for(i = 0; i <
slide
; i++) {
+ for(i = 0; i <
= term.c.y - row
; i++) {
free(term.line[i]);
free(term.alt[i]);
}
free(term.line[i]);
free(term.alt[i]);
}
- if(
slide
> 0) {
- memmove(term.line, term.line +
slide
, row * sizeof(Line));
- memmove(term.alt, term.alt +
slide
, row * sizeof(Line));
+ if(
i
> 0) {
+ memmove(term.line, term.line +
i
, row * sizeof(Line));
+ memmove(term.alt, term.alt +
i
, row * sizeof(Line));
}
for(i += row; i < term.row; i++) {
free(term.line[i]);
}
for(i += row; i < term.row; i++) {
free(term.line[i]);