[hackers] [scroll] Don't strip first two chars if they are not a \r\n || Jochen Sprickerhof

From: <git_AT_suckless.org>
Date: Mon, 6 Apr 2020 08:08:35 +0200 (CEST)

commit c6622082ff48417e85099a37549e83725227c958
Author: Jochen Sprickerhof <git_AT_jochen.sprickerhof.de>
AuthorDate: Sun Apr 5 23:50:02 2020 +0200
Commit: Jochen Sprickerhof <git_AT_jochen.sprickerhof.de>
CommitDate: Sun Apr 5 23:50:02 2020 +0200

    Don't strip first two chars if they are not a \r\n

diff --git a/scroll.c b/scroll.c
index 37eaf42..c1b7a73 100644
--- a/scroll.c
+++ b/scroll.c
_AT_@ -284,8 +284,10 @@ scrollup(int n)
         write(STDOUT_FILENO, "\033[?25l", 6);
 
         /* remove newline of first line as we are at 0,0 already */
- if (scrollend->size > 2)
+ if (scrollend->size > 1 && scrollend->buf[0] == '\r' && scrollend->buf[1] == '\n')
                 write(STDOUT_FILENO, scrollend->buf + 2, scrollend->size - 2);
+ else
+ write(STDOUT_FILENO, scrollend->buf, scrollend->size);
         bottom = TAILQ_NEXT(bottom, entries);
 
         /* print rows lines and move bottom forward to the new screen bottom */
Received on Mon Apr 06 2020 - 08:08:35 CEST

This archive was generated by hypermail 2.3.0 : Mon Apr 06 2020 - 08:12:37 CEST