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, 29 Sep 2024 07:29:42 -0400 (EDT)

branch: master
commit ab85f19e7476e750ddb330352b3d8831d8862933
Author: Patrice Dumas <pertusus@free.fr>
AuthorDate: Sat Jun 22 17:01:16 2024 +0200

    * tp/Texinfo/XS/parsetexi/parser.c (text_contents_to_plain_text): use
    text_append_n in ADD, as we always know the text length.
---
 ChangeLog                        |  5 +++++
 tp/Texinfo/XS/parsetexi/parser.c | 10 +++++-----
 2 files changed, 10 insertions(+), 5 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index e4ea3fb213..76f8a00571 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2024-06-22  Patrice Dumas  <pertusus@free.fr>
+
+       * tp/Texinfo/XS/parsetexi/parser.c (text_contents_to_plain_text): use
+       text_append_n in ADD, as we always know the text length.
+
 2024-06-22  Patrice Dumas  <pertusus@free.fr>
 
        * tp/Texinfo/XS/parsetexi/parser.c (text_contents_to_plain_text): do
diff --git a/tp/Texinfo/XS/parsetexi/parser.c b/tp/Texinfo/XS/parsetexi/parser.c
index c3988ad229..f4d32522b5 100644
--- a/tp/Texinfo/XS/parsetexi/parser.c
+++ b/tp/Texinfo/XS/parsetexi/parser.c
@@ -200,7 +200,7 @@ check_space_element (ELEMENT *e)
 char *
 text_contents_to_plain_text (ELEMENT *e, int *superfluous_arg)
 {
-#define ADD(x) text_append (&result, x)
+#define ADD(x,n) text_append_n (&result, x, n)
 
   TEXT result; int i;
 
@@ -211,17 +211,17 @@ text_contents_to_plain_text (ELEMENT *e, int 
*superfluous_arg)
       if (type_data[e1->type].flags & TF_text)
         {
           if (e1->e.text->end > 0)
-            ADD(e1->e.text->text);
+            ADD(e1->e.text->text, e1->e.text->end);
         }
       else if (e1->e.c->cmd == CM_AT_SIGN
                || e1->e.c->cmd == CM_atchar)
-        ADD("@");
+        ADD("@", 1);
       else if (e1->e.c->cmd == CM_OPEN_BRACE
                || e1->e.c->cmd == CM_lbracechar)
-        ADD("{");
+        ADD("{", 1);
       else if (e1->e.c->cmd == CM_CLOSE_BRACE
                || e1->e.c->cmd == CM_rbracechar)
-        ADD("}");
+        ADD("}", 1);
       else
         *superfluous_arg = 1;
     }



reply via email to

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