rbuic4 incorrectly breaks string literals (used in labels, etc.) when they exceed 1024 characters in length.
The problem lies with the fixString() function in rbuic/utils.h. Whenever the length of cursegment exceeds 1024, the
string is split into two with a newline added in between. This splitting repeats itself for every subsequent 1024th
character.
A long string such as:
"a very very ... very long string" (where ... represents a mass of characters)
is broken up into:
"a very very ... "
"very long string"
.. which is legal in C++, but not Ruby.
Attached is a patch that fixes this by inserting '+'. With this, the given example is split into:
"a very very ... " +
"long string"
The patch also performs splitting whenever newline characters are encountered in the input. This gives us a very neat
alignment of the string parts.
|