diff options
| author | noname@inventati.org <noname@inventati.org> | 2015-04-11 19:30:36 +0200 |
|---|---|---|
| committer | Roberto E. Vargas Caballero <k0ga@shike2.com> | 2015-04-13 10:18:08 +0200 |
| commit | c569e3146e6999f6a02acecd145929c87e15b528 (patch) | |
| tree | 1918772ec0b0973ba2197f0bd7c543c807db73fe | |
| parent | Move tresize comments around. (diff) | |
| download | st-c569e3146e6999f6a02acecd145929c87e15b528.tar.gz st-c569e3146e6999f6a02acecd145929c87e15b528.zip | |
Remove 'slide' variable in tresize.
Diffstat (limited to '')
| -rw-r--r-- | st.c | 9 |
1 files changed, 4 insertions, 5 deletions
| @@ -2769,7 +2769,6 @@ tresize(int col, int row) { | |||
| 2769 | int i; | 2769 | int i; |
| 2770 | int minrow = MIN(row, term.row); | 2770 | int minrow = MIN(row, term.row); |
| 2771 | int mincol = MIN(col, term.col); | 2771 | int mincol = MIN(col, term.col); |
| 2772 | int slide = term.c.y - row + 1; | ||
| 2773 | bool *bp; | 2772 | bool *bp; |
| 2774 | TCursor c; | 2773 | TCursor c; |
| 2775 | 2774 | ||
| @@ -2784,13 +2783,13 @@ tresize(int col, int row) { | |||
| 2784 | * tscrollup would work here, but we can optimize to | 2783 | * tscrollup would work here, but we can optimize to |
| 2785 | * memmove because we're freeing the earlier lines | 2784 | * memmove because we're freeing the earlier lines |
| 2786 | */ | 2785 | */ |
| 2787 | for(i = 0; i < slide; i++) { | 2786 | for(i = 0; i <= term.c.y - row; i++) { |
| 2788 | free(term.line[i]); | 2787 | free(term.line[i]); |
| 2789 | free(term.alt[i]); | 2788 | free(term.alt[i]); |
| 2790 | } | 2789 | } |
| 2791 | if(slide > 0) { | 2790 | if(i > 0) { |
| 2792 | memmove(term.line, term.line + slide, row * sizeof(Line)); | 2791 | memmove(term.line, term.line + i, row * sizeof(Line)); |
| 2793 | memmove(term.alt, term.alt + slide, row * sizeof(Line)); | 2792 | memmove(term.alt, term.alt + i, row * sizeof(Line)); |
| 2794 | } | 2793 | } |
| 2795 | for(i += row; i < term.row; i++) { | 2794 | for(i += row; i < term.row; i++) { |
| 2796 | free(term.line[i]); | 2795 | free(term.line[i]); |
