texinfo-commits
[Top][All Lists]
Advanced

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

[no subject]


From: Gavin D. Smith
Date: Thu, 3 Mar 2022 14:53:58 -0500 (EST)

branch: master
commit 288000ad334cff01b515410980433aa338b27f7e
Author: Gavin Smith <gavinsmith0123@gmail.com>
AuthorDate: Thu Mar 3 19:53:45 2022 +0000

    * tp/Texinfo/XS/parsetexi/input.c (set_input_encoding): Reset
    reverse_iconv conversion used in encode_name.  Report from Patrice.
---
 ChangeLog                         | 5 +++++
 tp/Texinfo/XS/parsetexi/input.c   | 8 ++++++--
 tp/t/results/include/cpp_lines.pl | 4 ++--
 3 files changed, 13 insertions(+), 4 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index e6e5d99341..40b898b9cf 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2022-03-03  Gavin Smith  <gavinsmith0123@gmail.com>
+
+       * tp/Texinfo/XS/parsetexi/input.c (set_input_encoding): Reset
+       reverse_iconv conversion used in encode_name.  Report from Patrice.
+
 2022-03-03  Gavin Smith  <gavinsmith0123@gmail.com>
 
        * NEWS: List new customization variables for filename encoding.
diff --git a/tp/Texinfo/XS/parsetexi/input.c b/tp/Texinfo/XS/parsetexi/input.c
index 71ca3a5ae5..f9ee396836 100644
--- a/tp/Texinfo/XS/parsetexi/input.c
+++ b/tp/Texinfo/XS/parsetexi/input.c
@@ -55,11 +55,17 @@ static char *input_pushback_string;
 enum character_encoding input_encoding;
 
 static char *input_encoding_name;
+static iconv_t reverse_iconv; /* used in encode_file_name */
 
 void
 set_input_encoding (char *encoding)
 {
   free (input_encoding_name); input_encoding_name = strdup (encoding);
+  if (reverse_iconv)
+    {
+      iconv_close (reverse_iconv);
+      reverse_iconv = (iconv_t) 0;
+    }
 
   if (!strcasecmp (encoding, "utf-8"))
     input_encoding = ce_utf8;
@@ -274,8 +280,6 @@ convert_to_utf8 (char *s)
   return ret;
 }
 
-static iconv_t reverse_iconv;
-
 /* Reverse the decoding of the filename to the input encoding, to retrieve
    the bytes that were present in the original Texinfo file.  Return
    value is freed by free_small_strings. */
diff --git a/tp/t/results/include/cpp_lines.pl 
b/tp/t/results/include/cpp_lines.pl
index 53c66df26e..aebc699440 100644
--- a/tp/t/results/include/cpp_lines.pl
+++ b/tp/t/results/include/cpp_lines.pl
@@ -708,7 +708,7 @@ $result_trees{'cpp_lines'} = {
           },
           'parent' => {},
           'source_info' => {
-            'file_name' => 'accentêd',
+            'file_name' => 'accentêd',
             'line_nr' => 7,
             'macro' => ''
           }
@@ -988,7 +988,7 @@ $result_errors{'cpp_lines'} = [
   {
     'error_line' => "warning: l\x{e0}ng is not a valid language code
 ",
-    'file_name' => 'accentêd',
+    'file_name' => 'accentêd',
     'line_nr' => 7,
     'macro' => '',
     'text' => "l\x{e0}ng is not a valid language code",



reply via email to

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