really unbreak kernel builds on sparc64 and powerpc64 after r324163, ZFS Channel Programs

This commit also reverts r324178 that did not fix the problem on powerpc64
where char is usigned.

MFC after:	4 weeks
X-MFC with:	r324163
This commit is contained in:
avg 2017-10-05 06:39:57 +00:00
parent e57bc68025
commit e4c95c2ee6

View File

@ -35,10 +35,11 @@
#ifdef illumos
#define tolower(C) (((C) >= 'A' && (C) <= 'Z') ? (C) - 'A' + 'a' : (C))
#define toupper(C) (((C) >= 'a' && (C) <= 'z') ? (C) - 'a' + 'A': (C))
#define iscntrl(C) ((((C) >= 0) && ((C) <= 0x1f)) || ((C) == 0x7f))
#else
#define isalnum(C) (isalpha(C) || isdigit(C))
#define iscntrl(C) (uchar(C) <= 0x1f || uchar(C) == 0x7f)
#endif
#define iscntrl(C) ((((C) >= 0) && ((C) <= 0x1f)) || ((C) == 0x7f))
#define isgraph(C) ((C) >= 0x21 && (C) <= 0x7E)
#define ispunct(C) (((C) >= 0x21 && (C) <= 0x2F) || \
((C) >= 0x3A && (C) <= 0x40) || \
@ -867,7 +868,7 @@ static void addquoted (lua_State *L, luaL_Buffer *b, int arg) {
luaL_addchar(b, '\\');
luaL_addchar(b, *s);
}
else if (*s == '\0' || iscntrl(*s)) {
else if (*s == '\0' || iscntrl(uchar(*s))) {
char buff[10];
if (!isdigit(uchar(*(s+1))))
sprintf(buff, "\\%d", (int)uchar(*s));