I did a little more digging.

I find that it's calling the NLSStringWidth function, which in turn calls the wcwidth function, which clearly writes that it can return -1 in some cases, but the NLSStringWidth isn't paying attention to that.

So it ends up returning -1 if it so happens that the number of positive wide characters happens to almost cancel out the number of non-printable ones. (Rare I guess.)

The -1 gets converted to an unsigned 4294967295, adding 1 a little later, and we have our crash.

Clearly the NLSStringWidth function isn't doing the right thing.

tcsh prints non-printables as \xxx, so NLSStringWidth should add 4 whenever it gets -1, that I think should fix it.

Except that that's not technically a proper 'string width' - does every usage of NLSStringWidth print out 4 characters in cases where wcwidth returns -1?

        -Ariel


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to