summary refs log tree commit diff
path: root/scan.c
diff options
context:
space:
mode:
authorChristian Neukirchen <chneukirchen@gmail.com>2016-07-17 21:49:34 +0200
committerChristian Neukirchen <chneukirchen@gmail.com>2016-07-17 21:49:34 +0200
commit66544292ff8d1073872efd9a1ca6fc0325556a96 (patch)
treef3a8fc63d34d8d36f5fe373ea88eb6611473002f /scan.c
parent61f3ae7d3c239abdfc145bf089598737af7ec678 (diff)
downloadmblaze-66544292ff8d1073872efd9a1ca6fc0325556a96.tar.gz
mblaze-66544292ff8d1073872efd9a1ca6fc0325556a96.tar.xz
mblaze-66544292ff8d1073872efd9a1ca6fc0325556a96.zip
scan: skip leading and trailing wsp
Diffstat (limited to 'scan.c')
-rw-r--r--scan.c6
1 files changed, 5 insertions, 1 deletions
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) {