texinfo-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[no subject]


From: Patrice Dumas
Date: Tue, 1 Oct 2024 12:40:09 -0400 (EDT)

branch: master
commit ffe3ae8e597fb8a629a3a7503251eef2ff086dae
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Thu Jul 25 17:01:38 2024 +0200

    * tp/Texinfo/XS/parsetexi/input.c (set_input_encoding)
    (parser_reset_encoding_list): use the general input_conversions from
    utils.c in the parser.  Remove parser_input_conversions.  Do not call
    reset_encoding_list in parser_reset_encoding_list such that conversion
    code can reuse the converter setup for the parsing.
---
 ChangeLog                       | 8 ++++++++
 tp/Texinfo/XS/parsetexi/api.c   | 3 ---
 tp/Texinfo/XS/parsetexi/input.c | 5 +----
 3 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 951bd9366f..e02e590c47 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2024-07-25  Patrice Dumas  <pertusus@free.fr>
+
+       * tp/Texinfo/XS/parsetexi/input.c (set_input_encoding)
+       (parser_reset_encoding_list): use the general input_conversions from
+       utils.c in the parser.  Remove parser_input_conversions.  Do not call
+       reset_encoding_list in parser_reset_encoding_list such that conversion
+       code can reuse the converter setup for the parsing.
+
 2024-07-25  Patrice Dumas  <pertusus@free.fr>
 
        * tp/Texinfo/XS/main/document.c (remove_document_descriptor): call
diff --git a/tp/Texinfo/XS/parsetexi/api.c b/tp/Texinfo/XS/parsetexi/api.c
index 42b0c360c0..8b0f2280c8 100644
--- a/tp/Texinfo/XS/parsetexi/api.c
+++ b/tp/Texinfo/XS/parsetexi/api.c
@@ -86,9 +86,6 @@ initialize_parsing (enum context root_ct)
   current_part = 0;
   source_marks_reset_counters ();
 
-  /* it is not totally obvious that is it better to reset the
-     list to avoid memory leaks rather than reuse the iconv
-     opened handlers */
   parser_reset_encoding_list ();
   set_input_encoding ("utf-8");
 
diff --git a/tp/Texinfo/XS/parsetexi/input.c b/tp/Texinfo/XS/parsetexi/input.c
index 2f67d73035..028f058fab 100644
--- a/tp/Texinfo/XS/parsetexi/input.c
+++ b/tp/Texinfo/XS/parsetexi/input.c
@@ -57,8 +57,6 @@ static char *input_pushback_string;
 
 static iconv_t reverse_iconv; /* used in encode_file_name */
 
-static ENCODING_CONVERSION_LIST parser_input_conversions = {0, 0, 0, 1};
-
 static ENCODING_CONVERSION *current_encoding_conversion = 0;
 
 /* ENCODING should always be lower cased */
@@ -77,7 +75,7 @@ set_input_encoding (const char *encoding)
     }
 
   current_encoding_conversion
-    = get_encoding_conversion (encoding, &parser_input_conversions);
+    = get_encoding_conversion (encoding, &input_conversions);
   if (current_encoding_conversion)
     {
       encoding_set = 1;
@@ -527,7 +525,6 @@ save_string (const char *string)
 void
 parser_reset_encoding_list (void)
 {
-  reset_encoding_list (&parser_input_conversions);
   /* could be named global_encoding_conversion and reset in wipe_global_info,
      but we prefer to keep it static as long as it is only used in one
      file */



reply via email to

[Prev in Thread] Current Thread [Next in Thread]