[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[no subject]
From: |
Patrice Dumas |
Date: |
Sat, 19 Oct 2024 14:55:42 -0400 (EDT) |
branch: master
commit 847df16c187701367ff62bcb3da8d892e114f1f3
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Sat Oct 19 20:52:07 2024 +0200
* tp/Texinfo/XS/main/customization_options.c
(options_list_add_option): replace option with the same name in list
if already there.
---
ChangeLog | 6 ++++++
tp/Texinfo/XS/main/customization_options.c | 14 ++++++++++++++
2 files changed, 20 insertions(+)
diff --git a/ChangeLog b/ChangeLog
index 79768d9aea..b9528f78d2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -32,6 +32,12 @@
This means files from libtoolize and gettextize should be
copied under tp/Texinfo/XS/m4, not tp/Texinfo/XS/gnulib/m4.
+2024-10-19 Patrice Dumas <pertusus@free.fr>
+
+ * tp/Texinfo/XS/main/customization_options.c
+ (options_list_add_option): replace option with the same name in list
+ if already there.
+
2024-10-19 Patrice Dumas <pertusus@free.fr>
* tp/Texinfo/XS/convert/converter.c
diff --git a/tp/Texinfo/XS/main/customization_options.c
b/tp/Texinfo/XS/main/customization_options.c
index 54dee604ce..d3507e7593 100644
--- a/tp/Texinfo/XS/main/customization_options.c
+++ b/tp/Texinfo/XS/main/customization_options.c
@@ -502,6 +502,20 @@ initialize_options_list (OPTIONS_LIST *options_list,
size_t number)
void
options_list_add_option (OPTIONS_LIST *options_list, OPTION *option)
{
+ size_t i;
+
+ for (i = 0; i < options_list->number; i++)
+ {
+ OPTION *list_option = options_list->list[i];
+ if (!strcmp (list_option->name, option->name))
+ {
+ free_option (list_option);
+ free (list_option);
+ options_list->list[i] = option;
+ return;
+ }
+ }
+
if (options_list->number >= options_list->space)
{
options_list->list = realloc (options_list->list,