This is clearer and portable to EBCDIC.
There is a subtle difference in the behavior here, which I believe is a
bug fix. Before, the code didn't treat DEL as a control, and now it
does.
itembytes = len;
send = chophere = s + itembytes;
while (s < send) {
- if (*s & ~31)
+ if (! isCNTRL(*s))
gotsome = TRUE;
else if (*s == '\n')
break;
itemsize = fieldsize;
send = chophere = s + itemsize;
while (s < send) {
- if (*s & ~31)
+ if (! isCNTRL(*s))
gotsome = TRUE;
else if (*s == '\n')
break;
chophere = s;
break;
}
- if (*s++ & ~31)
+ if (! isCNTRL(*s))
gotsome = TRUE;
+ s++;
}
}
else {
break;
}
else {
- if (*s & ~31)
+ if (! isCNTRL(*s))
gotsome = TRUE;
if (strchr(PL_chopset, *s))
chophere = s + 1;
chophere = s;
break;
}
- if (*s++ & ~31)
+ if (! isCNTRL(*s))
gotsome = TRUE;
+ s++;
}
}
else {
break;
}
else {
- if (*s & ~31)
+ if (! isCNTRL(*s))
gotsome = TRUE;
if (strchr(PL_chopset, *s))
chophere = s + 1;
U8 *send = s + to_copy;
while (s < send) {
const int ch = *s;
- if (trans == '~' ? (ch == '~') :
-#ifdef EBCDIC
- iscntrl(ch)
-#else
- (!(ch & ~31))
-#endif
- )
+ if (trans == '~' ? (ch == '~') : isCNTRL(ch))
*s = ' ';
s++;
}