Index: generic/nsf.c =================================================================== diff -u -ra2f1d9672f99e4e8a5981e11a6676dd174594883 -rf0bca18a085d7e071f54af9b4f0136b65ad1f8e6 --- generic/nsf.c (.../nsf.c) (revision a2f1d9672f99e4e8a5981e11a6676dd174594883) +++ generic/nsf.c (.../nsf.c) (revision f0bca18a085d7e071f54af9b4f0136b65ad1f8e6) @@ -7643,7 +7643,7 @@ const char *nextChars = ObjStr(nameObj); firstChar = *(nextChars ++); - if (isupper((int)firstChar)) { + if (CHARTYPE(upper, firstChar) != 0) { char buffer[1]; buffer[0] = (char)tolower((int)firstChar); @@ -16822,7 +16822,7 @@ if (unlikely(*value == '-' && (pPtr->flags & NSF_ARG_CHECK_NONPOS) != 0u - && isalpha(*(value+1)) + && CHARTYPE(alpha, (*(value+1))) != 0 && strchr(value+1, ' ') == NULL) ) { /* @@ -18087,7 +18087,7 @@ /* * Skip space at begin */ - for (start = j+1; start 0 && isspace((int)argString[end-1]); end--); + for (end = l; end > 0 && CHARTYPE(space, argString[end-1]) != 0; end--) { + ; + } result = ParamOptionParse(interp, argString, start, end-start, disallowedFlags, paramPtr, unescape, qualifier); unescape = NSF_FALSE; @@ -18115,16 +18117,17 @@ /* * Skip space from begin. */ - for (start = l; start 0 && isspace((int)argString[end-1]); end--); - + for (end = l; end > 0 && CHARTYPE(space, argString[end-1]) != 0; end--) { + ; + } /* * process last option */ @@ -24109,7 +24112,7 @@ flag = ObjStr(obj); /*fprintf(stderr, "we have a scalar '%s' isFirstArg %d\n", flag, isFirstArg);*/ - if ((*flag == '-') && isalpha(*((flag)+1))) { + if ((*flag == '-') && CHARTYPE(alpha, *((flag)+1)) != 0) { if (isFirstArg == 1) { /* * If the argument contains a space, try to split. Index: generic/nsfInt.h =================================================================== diff -u -rfc37052db0300fa580ab01429454387346030040 -rf0bca18a085d7e071f54af9b4f0136b65ad1f8e6 --- generic/nsfInt.h (.../nsfInt.h) (revision fc37052db0300fa580ab01429454387346030040) +++ generic/nsfInt.h (.../nsfInt.h) (revision f0bca18a085d7e071f54af9b4f0136b65ad1f8e6) @@ -184,7 +184,7 @@ #define nonnull_assert(assertion) assert((assertion)) /* - * Trie to use gcc __attribute__ unused and mangle the name, so the + * Try to use gcc __attribute__ "unused" and mangle the name, so the * attribute could not be used, if declared as unused. */ #ifdef UNUSED @@ -196,6 +196,10 @@ # define UNUSED(x) (x) #endif +#ifndef CHARTTYPE +# define CHARTYPE(what,c) (is ## what ((int)((unsigned char)(c)))) +#endif + #if defined(NSF_DTRACE) # include "nsfDTrace.h" # define NSF_DTRACE_METHOD_ENTRY_ENABLED() unlikely(NSF_METHOD_ENTRY_ENABLED())