texinfo-commits
[Top][All Lists]
Advanced

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

branch master updated: * tp/Texinfo/XS/xspara.c (xspara_add_text): Make


From: Gavin D. Smith
Subject: branch master updated: * tp/Texinfo/XS/xspara.c (xspara_add_text): Make the same change so to mirror the structure of the Perl code.
Date: Sun, 11 Dec 2022 12:42:41 -0500

This is an automated email from the git hooks/post-receive script.

gavin pushed a commit to branch master
in repository texinfo.

The following commit(s) were added to refs/heads/master by this push:
     new 0cb2922ae5 * tp/Texinfo/XS/xspara.c (xspara_add_text): Make the same 
change so to mirror the structure of the Perl code.
0cb2922ae5 is described below

commit 0cb2922ae54c1ed84dd9ff242066ecc543c0fc93
Author: Gavin Smith <gavinsmith0123@gmail.com>
AuthorDate: Sun Dec 11 17:42:34 2022 +0000

    * tp/Texinfo/XS/xspara.c (xspara_add_text): Make the same change
    so to mirror the structure of the Perl code.
---
 ChangeLog              |  5 +++++
 tp/Texinfo/XS/xspara.c | 38 +++++++++++++++++++++-----------------
 2 files changed, 26 insertions(+), 17 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index bf2b4200d2..6e9d17cfb6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2022-12-11  Gavin Smith  <gavinsmith0123@gmail.com>
+
+       * tp/Texinfo/XS/xspara.c (xspara_add_text): Make the same change
+       so to mirror the structure of the Perl code.
+
 2022-12-11  Gavin Smith  <gavinsmith0123@gmail.com>
 
        * tp/Texinfo/Convert/ParagraphNonXS.pm (add_text) <spaces>:
diff --git a/tp/Texinfo/XS/xspara.c b/tp/Texinfo/XS/xspara.c
index bf4ef91650..d9469e644f 100644
--- a/tp/Texinfo/XS/xspara.c
+++ b/tp/Texinfo/XS/xspara.c
@@ -842,8 +842,22 @@ xspara_add_text (char *text)
         {
           state.last_letter = L'\0';
 
-          /* If protect_spaces is on, ... */
-          if (state.protect_spaces)
+          if (state.unfilled)
+            {
+              xspara__add_pending_word (&result, 0);
+              if (*p == '\n')
+                {
+                   xspara__add_pending_word (&result, 0);
+                   xspara__end_line ();
+                   text_append (&result, "\n");
+                }
+              else
+                {
+                  text_append_n (&state.space, p, char_len);
+                  state.space_counter++;
+                }
+            }
+          else if (state.protect_spaces)
             {
               /* Append the spaces to the pending word. */
               text_append_n (&state.word, p, char_len);
@@ -874,13 +888,12 @@ xspara_add_text (char *text)
               int pending = state.invisible_pending_word;
               xspara__add_pending_word (&result, 0);
 
-              if (state.counter != 0 || state.unfilled || pending)
+              if (state.counter != 0 || pending)
                 {
                   /* If we are at the end of a sentence where two spaces
                      are required. */
                   if (state.end_sentence == 1
-                      && !state.french_spacing
-                      && !state.unfilled)
+                      && !state.french_spacing)
                     {
                       state.space.end = 0;
                       text_append_n (&state.space, "  ", 2);
@@ -889,21 +902,12 @@ xspara_add_text (char *text)
                   else /* Not at end of sentence. */
                     {
                       /* Only save the first space. */
-                      if (state.unfilled || state.space_counter < 1)
+                      if (state.space_counter < 1)
                         {
                           if (*p == '\n')
                             {
-                              if (!state.unfilled)
-                                {
-                                  text_append_n (&state.space, " ", 1);
-                                  state.space_counter++;
-                                }
-                              else
-                                {
-                                  xspara__add_pending_word (&result, 0);
-                                  xspara__end_line ();
-                                  text_append (&result, "\n");
-                                }
+                              text_append_n (&state.space, " ", 1);
+                              state.space_counter++;
                             }
                           else
                             {



reply via email to

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