summaryrefslogblamecommitdiff
path: root/user/mcpp/03-gniibe-fix-11.patch
blob: 576ac50e738d3dc59664b59cd2045a1ded4e3426 (plain) (tree)




















                                                                        
Description: Fix for a bug reported to sourceforge.net #11
Author: NIIBE Yutaka

Index: mcpp/src/support.c
===================================================================
--- mcpp.orig/src/support.c
+++ mcpp/src/support.c
@@ -1747,9 +1747,11 @@ not_comment:
                     *tp++ = '\t';
                 else
                     *tp++ = ' ';            /* Convert to ' '       */
-            } else if (! (char_type[ *(tp - 1) & UCHARMAX] & HSP)) {
+            } else if (temp == tp
+                       || ! (char_type[ *(tp - 1) & UCHARMAX] & HSP)) {
                 *tp++ = ' ';                /* Squeeze white spaces */
-            } else if (mcpp_mode == OLD_PREP && *(tp - 1) == COM_SEP) {
+            } else if (mcpp_mode == OLD_PREP && tp > temp
+                       && *(tp - 1) == COM_SEP) {
                 *(tp - 1) = ' ';    /* Replace COM_SEP with ' '     */
             }
             break;