Of Tobias Schlüter's comments the following was not addressed:
+ for (; char_ref; char_ref = char_ref->next)
+ if (char_ref->type == REF_SUBSTRING)
+ break;
He wrote: "Further, it probably makes sense to assert that the reference
is indeed the last in the chain. "
Paul's reply was: "(ii) I will change the initialization of the loop and
assert that the REF_SUBSTRING is the last in the chain - I actually
removed this assert because it seems to be caught further upstream.
However, it canot do any harm"
I think it is ok like thus, but I would also not oppose if an assert
will be added.