old Solaris. Fixes PR 32296 Jake Kupersmith. While here, add patch comment and use <ctype.h> correctly.