summaryrefslogtreecommitdiff
path: root/user/mcpp/03-gniibe-fix-11.patch
blob: 576ac50e738d3dc59664b59cd2045a1ded4e3426 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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;