summaryrefslogtreecommitdiff
path: root/user/mcpp/03-gniibe-fix-11.patch
diff options
context:
space:
mode:
Diffstat (limited to 'user/mcpp/03-gniibe-fix-11.patch')
-rw-r--r--user/mcpp/03-gniibe-fix-11.patch21
1 files changed, 21 insertions, 0 deletions
diff --git a/user/mcpp/03-gniibe-fix-11.patch b/user/mcpp/03-gniibe-fix-11.patch
new file mode 100644
index 000000000..576ac50e7
--- /dev/null
+++ b/user/mcpp/03-gniibe-fix-11.patch
@@ -0,0 +1,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;