commit 8bb1d81f539f1e223e8fcd79e2d18f58e3c9d28f
parent 963700d8d6e31aecfc14e12184637f4c3360f6ed
Author: Eyal Sawady <ecs@d2evs.net>
Date: Thu, 24 Sep 2020 15:32:16 -0400
gmnlm: handle CRLF line endings
Bare CRs are still printed as '.'.
Fixes https://todo.sr.ht/~sircmpwn/gmni/25
Diffstat:
1 file changed, 3 insertions(+), 0 deletions(-)
diff --git a/src/gmnlm.c b/src/gmnlm.c
@@ -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] = '.';