commit 01837b4187f91161b667c3a2f4ea530569322a35
parent 63d353a9c731f969c44ae5d30574b30907fe8e17
Author: Vincent Forest <vincent.forest@meso-star.com>
Date: Sun, 31 Aug 2025 16:43:12 +0200
Correcting multilingual indexed content
When successive index entries used the same multilingual URI pattern,
some entries might not have been displayed in the menu.
Diffstat:
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/tools/generate_header.c b/tools/generate_header.c
@@ -747,8 +747,8 @@ print_menu2
if(i) printf("  . \n");
- /* Resolve the URI lang with the selectedy entry if any or the current entry
- * otherwise */
+ /* * Resolve the URI language with the selected entry if it exists, or the
+ * current entry if not */
if(!(uri=expand_lang(entry->template, lang))) goto error;
/* This is the indexed content */
@@ -767,11 +767,13 @@ print_menu2
root, section, entry->uri, entry->label);
}
- /* Remove elements with the same template to avoid duplicates when the
- * indexed content offers multiple translations. Note that the following
- * loop ensures that the index increment by the main loop remains valid,
- * i.e., does not skip an entry. */
- while(i+1 < n && !strcmp(entry->template, index->items[i+1].template)) {
+ /* Remove elements with the same template for the current label to avoid
+ * duplicates when the indexed content offers multiple translations. Note
+ * that the following loop ensures that the index increment by the main
+ * loop remains valid, i.e., does not skip an entry. */
+ while(i+1 < n
+ && !strcmp(entry->template, index->items[i+1].template)
+ && !strcmp(entry->label, index->items[i+1].label)) {
i += 1;
}