texinfo-commits
[Top][All Lists]
Advanced

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

[7048] Do not call text_append_n with (size_t)-1.


From: Gavin D. Smith
Subject: [7048] Do not call text_append_n with (size_t)-1.
Date: Mon, 21 Mar 2016 07:49:31 +0000

Revision: 7048
          http://svn.sv.gnu.org/viewvc/?view=rev&root=texinfo&revision=7048
Author:   gavin
Date:     2016-03-21 07:49:18 +0000 (Mon, 21 Mar 2016)
Log Message:
-----------
Do not call text_append_n with (size_t)-1.

Modified Paths:
--------------
    trunk/ChangeLog
    trunk/tp/Texinfo/Convert/XSParagraph/xspara.c

Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog     2016-03-20 19:23:30 UTC (rev 7047)
+++ trunk/ChangeLog     2016-03-21 07:49:18 UTC (rev 7048)
@@ -1,3 +1,8 @@
+2016-03-21  Thomas Klausner  <address@hidden> (tiny change)
+
+       *  tp/Texinfo/Convert/XSParagraph/xspara.c (xspara_add_text):
+       Do not call text_append_n with (size_t)-1.  Fix typos.
+
 2016-03-20  Masamichi Hosoda  <address@hidden>
 
        * doc/texinfo.tex (\ifpassthroughchars):

Modified: trunk/tp/Texinfo/Convert/XSParagraph/xspara.c
===================================================================
--- trunk/tp/Texinfo/Convert/XSParagraph/xspara.c       2016-03-20 19:23:30 UTC 
(rev 7047)
+++ trunk/tp/Texinfo/Convert/XSParagraph/xspara.c       2016-03-21 07:49:18 UTC 
(rev 7048)
@@ -882,7 +882,7 @@
                         {
                           if (state.space_counter > 0)
                             {
-                              /* Truncuate to at most 2 spaces, and replace 
any 
+                              /* Truncate to at most 2 spaces, and replace any 
                                  '\n' or '\r' characters with ' '. */
 
                               TEXT new_space;
@@ -902,12 +902,16 @@
                                     break;
                                   len = mbrlen (pspace, pspace_left, NULL);
 
-                                  /* Subtitute newlines in the pending space
+                                  /* Substitute newlines in the pending space
                                      with spaces. */
                                   if (*pspace == '\n' || *pspace == '\r')
                                     text_append_n (&new_space, " ", 1);
+                                  else if (len > 0)
+                                    text_append_n (&new_space, pspace, len);
                                   else
-                                    text_append_n (&new_space, pspace, len);
+                                    /* Skip one character and try again. */
+                                    len = 1;
+
                                   state.space_counter++;
 
                                   pspace += len;




reply via email to

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