Skip to content

Commit

Permalink
Skip empty lines at end of code block
Browse files Browse the repository at this point in the history
  • Loading branch information
karlb authored and Gottox committed Jul 1, 2020
1 parent 3e00cae commit b76e431
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions smu.c
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,12 @@ dolineprefix(const char *begin, const char *end, int newblock) {
p += l;
}
}

/* Skip empty lines in block */
while(*(buffer + j - 1) == '\n') {
j--;
}

ADDC(buffer, j) = '\0';
if(lineprefix[i].process)
process(buffer, buffer + strlen(buffer), lineprefix[i].process >= 2);
Expand Down

0 comments on commit b76e431

Please sign in to comment.