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 == '\n') {
if(p + 1 == end) if(p + 1 == end)
break; break;
else if(p[1] == '\n') { else {
p++; /* Handle empty lines */
ADDC(buffer, i) = '\n'; for(q = p + 1; (*q == ' ' || *q == '\t') && q < end; q++);
i++; if(*q == '\n') {
run = 0; ADDC(buffer, i) = '\n';
isblock++; i++;
run = 0;
isblock++;
p = q;
}
} }
q = p + 1; q = p + 1;
j = 0; j = 0;