mirror of
https://git.sr.ht/~sircmpwn/gmni
synced 2024-11-23 04:51:59 +01:00
gmnlm: handle CRLF line endings
Bare CRs are still printed as '.'. Fixes https://todo.sr.ht/~sircmpwn/gmni/25
This commit is contained in:
parent
963700d8d6
commit
8bb1d81f53
@ -380,6 +380,9 @@ wrap(FILE *f, char *s, struct winsize *ws, int *row, int *col)
|
||||
case '\t':
|
||||
*col = *col + (8 - *col % 8);
|
||||
break;
|
||||
case '\r':
|
||||
if (!s[i+1]) break;
|
||||
/* fallthrough */
|
||||
default:
|
||||
if (iscntrl(s[i])) {
|
||||
s[i] = '.';
|
||||
|
Loading…
Reference in New Issue
Block a user