this might fix that not parsing smileys at end of line (really smileys
butted up against a tag, e.g. ":-)")
But I didn't have time to test it. But at least it compiles.
/*
* A lot of this code (especially the config code) was taken directly
* or nearly directly from xchat, version 1.4.2 by Peter Zelezny and others.