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

16
smu.c
View file

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