Handle empty lines with whitespace in lists

This commit is contained in:
Karl Bartel 2019-10-03 13:24:15 +02:00 committed by Enno Boland
parent 23241209f8
commit 2a8d5b1a6b

8
smu.c
View file

@ -371,12 +371,16 @@ dolist(const char *begin, const char *end, int newblock) {
if(*p == '\n') { if(*p == '\n') {
if(p + 1 == end) if(p + 1 == end)
break; break;
else if(p[1] == '\n') { else {
p++; /* Handle empty lines */
for(q = p + 1; (*q == ' ' || *q == '\t') && q < end; q++);
if(*q == '\n') {
ADDC(buffer, i) = '\n'; ADDC(buffer, i) = '\n';
i++; i++;
run = 0; run = 0;
isblock++; isblock++;
p = q;
}
} }
q = p + 1; q = p + 1;
j = 0; j = 0;