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));
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to