The getopt() function returns an int, not a char. On systems where the default char is unsigned (like ppc), we get weird behavior where -1 is truncated to 0xff but compared to (int)-1.
http://bugs.gentoo.org/299386
fix
fix