svn commit: r324292 - head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lua
Andriy Gapon
avg at FreeBSD.org
Thu Oct 5 06:39:58 UTC 2017
Author: avg
Date: Thu Oct 5 06:39:57 2017
New Revision: 324292
URL: https://svnweb.freebsd.org/changeset/base/324292
Log:
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
Modified:
head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lua/lstrlib.c
Modified: head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lua/lstrlib.c
==============================================================================
--- head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lua/lstrlib.c Wed Oct 4 23:35:10 2017 (r324291)
+++ head/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/lua/lstrlib.c Thu Oct 5 06:39:57 2017 (r324292)
@@ -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, i
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));
More information about the svn-src-all
mailing list