tags 339683 + patch
kthxbye

So it turns out that cpp also skips trailing whitespace:
'#define FOO bar \n'
turns 'FOO' into 'bar' with the cpp from gcc.  So I'd say that if it's
not *correct* behaviour (which it almost certainly is), then it's
probably expected. ;)

I've also attached a patch which implements this, and works.

Cheers,
Daniel
diff -u mcpp-2.5/src/expand.c mcpp-2.5/src/expand.c
--- mcpp-2.5/src/expand.c
+++ mcpp-2.5/src/expand.c
@@ -313,9 +313,14 @@
             if (c == IN_SRC)
                 continue;                   /* Skip IN_SRC          */
             else if (c == TOK_SEP) {
-                if (c1 == ' ')
-                    continue;
                 c = ' ';
+                /* Ubuntu change: skip all spaces, otherwise:
+                 * #define "FOO" "bar" (quotes added for clarity)
+                 * expands "FOO" to "bar "
+                 * which breaks xrdb.
+                 * pretty badly, as it turns out.
+                 * -daniels
+                 */
                 continue;
             }
         }
diff -u mcpp-2.5/debian/changelog mcpp-2.5/debian/changelog
--- mcpp-2.5/debian/changelog
+++ mcpp-2.5/debian/changelog
@@ -1,3 +1,10 @@
+mcpp (2.5-1ubuntu1) dapper; urgency=low
+
+  * expand.c: Skip all TOK_SEPs, not just every one after the first (closes:
+    Ubuntu#19679, Malone#4506).
+
+ -- Daniel Stone <[EMAIL PROTECTED]>  Fri, 18 Nov 2005 09:32:33 +1100
+
 mcpp (2.5-1) unstable; urgency=low
 
   * New upstream release

Attachment: signature.asc
Description: Digital signature

Reply via email to