summaryrefslogtreecommitdiff
path: root/user/mcpp/03-gniibe-fix-11.patch
diff options
context:
space:
mode:
authorZach van Rijn <me@zv.io>2022-11-11 16:44:51 -0600
committerZach van Rijn <me@zv.io>2022-11-11 16:58:38 -0600
commitab1c259053596aaee4310a5e3f09591755e4ccf8 (patch)
tree7946463282d30de809ba08895558675f5a49acea /user/mcpp/03-gniibe-fix-11.patch
parent451e5cf47f3a45ebf46cad0940f07ef05324f4c5 (diff)
downloadpackages-ab1c259053596aaee4310a5e3f09591755e4ccf8.tar.gz
packages-ab1c259053596aaee4310a5e3f09591755e4ccf8.tar.bz2
packages-ab1c259053596aaee4310a5e3f09591755e4ccf8.tar.xz
packages-ab1c259053596aaee4310a5e3f09591755e4ccf8.zip
user/mcpp: pull miscellaneous patches. fixes #169.
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;