diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2022-05-03 21:54:22 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2022-05-03 21:54:22 -0700 |
commit | e6beaea9003be2fabd5de898d30f5f7c876e2534 (patch) | |
tree | a66099ab5ded6b3975bddc36303b5d90d39da2e3 /pw.c | |
parent | 39c3e17e5fa989a5db5825ceb9be54ba77c7b92d (diff) | |
download | pw-e6beaea9003be2fabd5de898d30f5f7c876e2534.tar.gz pw-e6beaea9003be2fabd5de898d30f5f7c876e2534.tar.bz2 pw-e6beaea9003be2fabd5de898d30f5f7c876e2534.zip |
Don't retrace if there are no lines to draw.
In this case, things go funny because the ANSI escape
sequence ^[[0A will still go up one line, in spite
of the zero.
Diffstat (limited to 'pw.c')
-rw-r--r-- | pw.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -446,7 +446,7 @@ static unsigned redraw(char **circbuf, int nlines, unsigned hpos, unsigned hist, if ((stat & stat_bkgnd)) return stat; - if (updln) { + if (updln && snaplines[hist] > 0) { printf("\r\033[%dA", snaplines[hist]); if ((stat & stat_lino) == 0) { for (int i = 0; i < snaplines[hist]; i++) |