From 66544292ff8d1073872efd9a1ca6fc0325556a96 Mon Sep 17 00:00:00 2001 From: Christian Neukirchen Date: Sun, 17 Jul 2016 21:49:34 +0200 Subject: [PATCH] scan: skip leading and trailing wsp --- scan.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scan.c b/scan.c index 7fa58d0..3da54fe 100644 --- a/scan.c +++ b/scan.c @@ -38,11 +38,15 @@ oneline(char *file) lineno++; int indent = 0; - while (*file == ' ') { + while (*file == ' ' || *file == '\t') { indent++; file++; } indent *= 2; + + char *e = file + strlen(file) - 1; + while (file < e && (*e == ' ' || *e == '\t')) + *e-- = 0; struct message *msg = blaze822(file); if (!msg) {