Handle empty lines with whitespace in lists
This commit is contained in:
parent
23241209f8
commit
2a8d5b1a6b
1 changed files with 10 additions and 6 deletions
16
smu.c
16
smu.c
|
@ -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;
|
||||||
|
|
Loading…
Add table
Reference in a new issue