mcpp eating last character of words - this breaks xrdb

Bug #139910 reported by divVerent
2
Affects Status Importance Assigned to Milestone
mcpp (Ubuntu)
Fix Released
High
Matthias Klose

Bug Description

Binary package hint: mcpp

Note: this is not a duplicate of #33728, it is a new bug.

mcpp, when used with the -@old option like xrdb does, cuts off the last character of every but the last word in each line.

This breaks files like .Xresources:

rxvt*font: -misc-Atari ST 8x16 system font-medium-r-normal--10-100-100-100-m-100-iso8859-15
becomes
rxvt*font -misc-Atar S 8x1 syste font-medium-r-normal--10-100-100-100-m-100-iso8859-15

I see that the bug has been worked around by making xrdb no longer call mcpp with -@old (I noticed it during an upgrade, and xrdb hasn't been reconfigured yet when it happened). Still, mcpp is obviously broken, even when supplying C code:

$ echo "main() { return 0; }" | mcpp -@old
#line 1 "<stdin>"
main( retur 0 }

Assuming mcpp is a C preprocessor, this should not happen - this line is perfectly valid "old" C, and thus should be processed correctly by mcpp even in "old" mode.

Because the only program using mcpp has been reconfigured to work around this bug, I'd call this bug uncritical, but it should either be fixed or mcpp get removed and cpp used instead.

Related branches

Matthias Klose (doko)
Changed in mcpp:
assignee: nobody → doko
importance: Undecided → High
status: New → Confirmed
Revision history for this message
Matthias Klose (doko) wrote :

mcpp (2.6.4-1ubuntu2) gutsy; urgency=low

  * Fix truncation of symbols in -@old mode (Kiyoshi Matsui). LP: #139910.

 -- Matthias Klose <email address hidden> Tue, 18 Sep 2007 12:01:34 +0200

Changed in mcpp:
status: Confirmed → Fix Released
Revision history for this message
Matthias Klose (doko) wrote :

> mcpp, when used with the -@old option like xrdb does,

no, xrdb does use mcpp -a

Revision history for this message
divVerent (divverent) wrote :

Correct, in gutsy, it does not use mcpp -@old any more. As said, I noticed the problem during the update from feisty to gutsy after the kdm restart because of a new PAM. Later, the dist-upgrade apparently replaced xrdb or changed its settings to not use -@old any more.

In Feisty, it still uses -@old:

polzer:~ 3> DISPLAY=:1 strace -fe execve xrdb -merge ~/.Xresources
execve("/usr/bin/xrdb", ["xrdb", "-merge", "/home/polzer/.Xresources"], [/* 29 vars */]) = 0
Process 29238 attached
[pid 29238] execve("/bin/sh", ["sh", "-c", "/usr/bin/mcpp -@old -DHOST=hagge"...], [/* 29 vars */]) = 0

But, as the bug is fixed now... it won't happen that the buggy version possibly enters feisty backports, or something like that.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.