Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#78 Solaris 10 64bit build crashes on cursor right

open
nobody
ZLE (6)
5
2013-01-25
2012-06-18
clh
No

When compiled on Solaris 10 (or earlier) as 64bit, zsh will crash every time cursor right is pressed.

This is due to Solaris Bug 1240072. The bug causes tgoto() not to be declared in term.h, if __STDC__ is set. The bug is fixed in
Solaris 11, but not in Solaris 10 or earlier.

Due to the missing prototype, the char pointer returned by tgoto() will be cast to int. This works on 32bit builds, but will truncate the pointer on 64bit builds, as the 64 bit pointer will be cast to a 32 bit int.

tgoto() is used only once in Src/Zle/zle_refresh.c:

static void
tcoutarg(int cap, int arg)
{
char *result;

result = tgoto(tcstr[cap], arg, arg);

When tgoto() is manually declared in Src/Zle/zle_refresh.c, the code works as expected.

Discussion