Get rid of unneeded variables.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67
diff --git a/md4c/md4c.c b/md4c/md4c.c
index f4cd66b..00492d0 100644
--- a/md4c/md4c.c
+++ b/md4c/md4c.c
@@ -110,19 +110,17 @@ struct MD_CTX_tag {
#define ASTERISK_OPENERS ctx->mark_chains[2]
#define UNDERSCORE_OPENERS ctx->mark_chains[3]
- /* For MD_BLOCK_QUOTE */
- unsigned quote_level; /* Nesting level. */
-
/* Minimal indentation to call the block "indented code". */
unsigned code_indent_offset;
+ /* For MD_BLOCK_QUOTE */
+ unsigned quote_level; /* Nesting level. */
+
/* For MD_BLOCK_HEADER. */
unsigned header_level;
/* For MD_BLOCK_CODE (fenced). */
- CHAR code_fence_char; /* '~' or '`' */
SZ code_fence_length;
- OFF code_fence_indent;
OFF code_fence_info_beg;
OFF code_fence_info_end;
@@ -2018,20 +2016,18 @@ md_is_opening_code_fence(MD_CTX* ctx, OFF beg, OFF* p_end)
while(off > ctx->code_fence_info_beg && CH(off-1) == _T(' '))
off--;
ctx->code_fence_info_end = off;
-
- ctx->code_fence_char = CH(beg);
return 0;
}
static int
-md_is_closing_code_fence(MD_CTX* ctx, OFF beg, OFF* p_end)
+md_is_closing_code_fence(MD_CTX* ctx, CHAR ch, OFF beg, OFF* p_end)
{
OFF off = beg;
int ret = -1;
/* Closing fence must have at least the same length and use same char as
* opening one. */
- while(off < ctx->size && CH(off) == ctx->code_fence_char)
+ while(off < ctx->size && CH(off) == ch)
off++;
if(off - beg < ctx->code_fence_length)
goto out;
@@ -2280,7 +2276,7 @@ redo_indentation_after_blockquote_mark:
/* We are another MD_LINE_FENCEDCODE unless we are closing fence
* which we transform into MD_LINE_BLANK. */
if(line->indent < ctx->code_indent_offset) {
- if(md_is_closing_code_fence(ctx, off, &off) == 0) {
+ if(md_is_closing_code_fence(ctx, CH(pivot_line->beg), off, &off) == 0) {
line->type = MD_LINE_BLANK;
goto done;
}
@@ -2385,7 +2381,6 @@ redo_indentation_after_blockquote_mark:
/* Check whether we are starting code fence. */
if(CH(off) == _T('`') || CH(off) == _T('~')) {
if(md_is_opening_code_fence(ctx, off, &off) == 0) {
- ctx->code_fence_indent = line->indent;
line->type = MD_LINE_FENCEDCODE;
goto done;
}