Skip to content

Commit

Permalink
Handle empty lines with whitespace in lists
Browse files Browse the repository at this point in the history
  • Loading branch information
karlb authored and Gottox committed Jul 1, 2020
1 parent 2324120 commit 2a8d5b1
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions smu.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 2a8d5b1

Please sign in to comment.