Skip to content

Commit

Permalink
Try to match existing style better.
Browse files Browse the repository at this point in the history
  • Loading branch information
btrask committed Apr 7, 2015
1 parent b8aa649 commit 271d8a1
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/blocks.c
Original file line number Diff line number Diff line change
Expand Up @@ -213,10 +213,10 @@ finalize(cmark_parser *parser, cmark_node* b)
(b->type == NODE_HEADER && b->as.header.setext)) {
b->end_line = parser->line_number;
b->end_column = parser->curline->size;
if (b->end_column && parser->curline->ptr[b->end_column-1] == '\n')
b->end_column -= 1;
if (b->end_column && parser->curline->ptr[b->end_column-1] == '\r')
b->end_column -= 1;
if (b->end_column && parser->curline->ptr[b->end_column - 1] == '\n')
b->end_column--;
if (b->end_column && parser->curline->ptr[b->end_column - 1] == '\r')
b->end_column--;
} else {
b->end_line = parser->line_number - 1;
b->end_column = parser->last_line_length;
Expand Down Expand Up @@ -895,11 +895,11 @@ S_process_line(cmark_parser *parser, const unsigned char *buffer, size_t bytes)
finished:
parser->last_line_length = parser->curline->size;
if (parser->last_line_length &&
parser->curline->ptr[parser->last_line_length-1] == '\n')
parser->last_line_length -= 1;
parser->curline->ptr[parser->last_line_length - 1] == '\n')
parser->last_line_length--;
if (parser->last_line_length &&
parser->curline->ptr[parser->last_line_length-1] == '\r')
parser->last_line_length -= 1;
parser->curline->ptr[parser->last_line_length - 1] == '\r')
parser->last_line_length--;

cmark_strbuf_clear(parser->curline);

Expand Down

0 comments on commit 271d8a1

Please sign in to comment.