[liblouis-liblouisxml] [liblouisutdml] push by mwhapples - Do not strip trailing whitespace if there is only space characters. on 2014-05-20 09:16 GMT

  • From: liblouisutdml@xxxxxxxxxxxxxx
  • To: liblouis-liblouisxml@xxxxxxxxxxxxx
  • Date: Tue, 20 May 2014 09:16:45 +0000

Revision: 8780753f80a6
Branch:   default
Author:   Michael Whapples
Date:     Tue May 20 09:26:44 2014 UTC
Log: Do not strip trailing whitespace if there is only space characters.
http://code.google.com/p/liblouisutdml/source/detail?r=8780753f80a6

Modified:
 /liblouisutdml/transcriber.c

=======================================
--- /liblouisutdml/transcriber.c        Fri May 16 20:08:50 2014 UTC
+++ /liblouisutdml/transcriber.c        Tue May 20 09:26:44 2014 UTC
@@ -1081,7 +1081,13 @@
 {
   int length = strlen ((char *) node->content);
   int k;
-  for (k = length; k > 0 && node->content[k - 1] <= 32; k--);
+  int stripSpace = 0;
+  for (k = length; k > 0 && node->content[k - 1] <= 32; k--)
+    // We want to track if the node only contains space 0x20 characters
+    if (node->content[k - 1] != 32)
+      stripSpace = 1;
+  if (stripSpace == 0)
+    k = length; // We want to keep the spaces
   if (k <= 0)
     return;
   if (k < length)
For a description of the software, to download it and links to
project pages go to http://www.abilitiessoft.com

Other related posts:

  • » [liblouis-liblouisxml] [liblouisutdml] push by mwhapples - Do not strip trailing whitespace if there is only space characters. on 2014-05-20 09:16 GMT - liblouisutdml