texinfo-commits
[Top][All Lists]
Advanced

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

[no subject]


From: Patrice Dumas
Date: Sun, 20 Oct 2024 18:18:09 -0400 (EDT)

branch: master
commit 7bc637594d5ccd0417de79e73262172f27c5f78e
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Mon Oct 21 00:17:14 2024 +0200

    * tp/Texinfo/XS/main/build_perl_info.c
    (pass_document_parser_errors_to_registrar): setup a new registrar only
    if there is not one already.
---
 ChangeLog                            |  6 ++++++
 tp/Texinfo/XS/main/build_perl_info.c | 16 +++++++++++++---
 2 files changed, 19 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 01cb3aea69..b3baa9eeb1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2024-10-20  Patrice Dumas  <pertusus@free.fr>
+
+       * tp/Texinfo/XS/main/build_perl_info.c
+       (pass_document_parser_errors_to_registrar): setup a new registrar only
+       if there is not one already.
+
 2024-10-20  Patrice Dumas  <pertusus@free.fr>
 
        * tp/Texinfo/XS/parsetexi/Parsetexi.xs (parse_texi_piece): remove the
diff --git a/tp/Texinfo/XS/main/build_perl_info.c 
b/tp/Texinfo/XS/main/build_perl_info.c
index 061e8d0927..c13fccbef2 100644
--- a/tp/Texinfo/XS/main/build_perl_info.c
+++ b/tp/Texinfo/XS/main/build_perl_info.c
@@ -1338,6 +1338,7 @@ pass_document_parser_errors_to_registrar (size_t 
document_descriptor,
   SV *errors_warnings_sv = 0;
   SV *error_nrs_sv = 0;
   HV *parser_hv;
+  SV **parser_registrar_sv;
 
   dTHX;
 
@@ -1352,9 +1353,18 @@ pass_document_parser_errors_to_registrar (size_t 
document_descriptor,
    */
 
   /* Add error registrar to Parser */
-  registrar_sv = new_texinfo_report ();
-  SvREFCNT_inc (registrar_sv);
-  hv_store (parser_hv, "registrar", strlen ("registrar"), registrar_sv, 0);
+  parser_registrar_sv = hv_fetch (parser_hv, "registrar",
+                                  strlen ("registrar"), 0);
+  if (parser_registrar_sv)
+    {
+      registrar_sv = *parser_registrar_sv;
+    }
+  else
+    {
+      registrar_sv = new_texinfo_report ();
+      SvREFCNT_inc (registrar_sv);
+      hv_store (parser_hv, "registrar", strlen ("registrar"), registrar_sv, 0);
+    }
 
   pass_errors_to_registrar (&document->parser_error_messages, parser_sv,
                             &errors_warnings_sv, &error_nrs_sv);



reply via email to

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