чување 92f871cc5278799f7b305f8f050316feb4f74f03
родитељ e583adf3ce7c4dba70fea7bb2a95bf15abca2a68
Аутор: Страхиња Радић <sr@strahinja.org>
Датум: Mon, 22 Jul 2024 21:15:29 +0200
slweb.c: Rollback *footnote_count adjustments
Diffstat:
измењених датотека: 1, додавања: 2(+), брисања: 4(-)
diff --git a/slweb.c b/slweb.c
@@ -1180,6 +1180,7 @@ process_footnote(FILE* output, const u8* token, const int footnote_definition,
current_footnote++;
if (footnote_definition)
{
+ footnote_count++;
if (footnote_count == 1 && inline_footnote_count > 0)
warning(1,
(u8*)"Both inline and regular footnotes "
@@ -1192,7 +1193,6 @@ process_footnote(FILE* output, const u8* token, const int footnote_definition,
}
else
{
- footnote_count++;
REALLOCARRAY(footnotes, KeyValue, footnote_count);
pfootnotes = footnotes + footnote_count - 1;
}
@@ -1779,6 +1779,7 @@ process_inline_footnote(const u8* token, const int read_yaml_macros_and_links,
if (read_yaml_macros_and_links)
{
token_len = strlen((char*)token);
+ inline_footnote_count++;
if (inline_footnote_count == 1 && footnote_count > 0)
warning(1,
(u8*)"Both inline and regular footnotes "
@@ -1789,11 +1790,8 @@ process_inline_footnote(const u8* token, const int read_yaml_macros_and_links,
CALLOC(inline_footnotes, u8*, inline_footnote_count);
}
else
- {
- inline_footnote_count++;
REALLOC(inline_footnotes, u8*,
sizeof(u8*) * inline_footnote_count);
- }
CALLOC(inline_footnotes[inline_footnote_count - 1], u8,
token_len + 1);
MEMCCPY(inline_footnotes[inline_footnote_count - 1],