Fix unportable usages of tolower(). On signed-char machines, it is necessary

Tom Lane <tgl@sss.pgh.pa.us>

Commit: 0b173a6e8df85aa2a924003188520adda3e2d16b
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: 2008-03-01T03:26:44Z
Releases: 8.3.1
Fix unportable usages of tolower().  On signed-char machines, it is necessary
to explicitly cast the output back to char before comparing it to a char
value, else we get the wrong result for high-bit-set characters.  Found by
Rolf Jentsch.  Also, fix several places where <ctype.h> functions were being
called without casting the argument to unsigned char; this is likewise
unportable, but we keep making that mistake :-(.  These found by buildfarm
member salamander, which I will desperately miss if it ever goes belly-up.

Files