- s = dest;
- wcs = dest;
-
- if (*++p == '^') p++, invert = 1;
- else invert = 0;
-
- unsigned char scanset[257];
- memset(scanset, invert, sizeof scanset);
-
- scanset[0] = 0;
- if (*p == '-') p++, scanset[1+'-'] = 1-invert;
- else if (*p == ']') p++, scanset[1+']'] = 1-invert;
- for (; *p != ']'; p++) {
- if (!*p) goto fmt_fail;
- if (*p=='-' && p[1] && p[1] != ']')
- for (c=p++[-1]; c<*p; c++)
- scanset[1+c] = 1-invert;
- scanset[1+*p] = 1-invert;
+ if (t == 'c' || t == 's') {
+ memset(scanset, -1, sizeof scanset);
+ scanset[0] = 0;
+ if (t == 's') {
+ scanset[1+'\t'] = 0;
+ scanset[1+'\n'] = 0;
+ scanset[1+'\v'] = 0;
+ scanset[1+'\f'] = 0;
+ scanset[1+'\r'] = 0;
+ scanset[1+' '] = 0;
+ }
+ } else {
+ if (*++p == '^') p++, invert = 1;
+ else invert = 0;
+ memset(scanset, invert, sizeof scanset);
+ scanset[0] = 0;
+ if (*p == '-') p++, scanset[1+'-'] = 1-invert;
+ else if (*p == ']') p++, scanset[1+']'] = 1-invert;
+ for (; *p != ']'; p++) {
+ if (!*p) goto fmt_fail;
+ if (*p=='-' && p[1] && p[1] != ']')
+ for (c=p++[-1]; c<*p; c++)
+ scanset[1+c] = 1-invert;
+ scanset[1+*p] = 1-invert;
+ }