Change NUL char handling of isspecial()
[git/kirr.git] / ctype.c
blob9de187c812ff39a5cd7bbe81d9808130c9c40bec
1 /*
2 * Sane locale-independent, ASCII ctype.
4 * No surprises, and works with signed and unsigned chars.
5 */
6 #include "cache.h"
8 enum {
9 S = GIT_SPACE,
10 A = GIT_ALPHA,
11 D = GIT_DIGIT,
12 G = GIT_GLOB_SPECIAL, /* *, ?, [, \\ */
15 unsigned char sane_ctype[256] = {
16 0, 0, 0, 0, 0, 0, 0, 0, 0, S, S, 0, 0, S, 0, 0, /* 0.. 15 */
17 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 16.. 31 */
18 S, 0, 0, 0, 0, 0, 0, 0, 0, 0, G, 0, 0, 0, 0, 0, /* 32.. 47 */
19 D, D, D, D, D, D, D, D, D, D, 0, 0, 0, 0, 0, G, /* 48.. 63 */
20 0, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, /* 64.. 79 */
21 A, A, A, A, A, A, A, A, A, A, A, G, G, 0, 0, 0, /* 80.. 95 */
22 0, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, /* 96..111 */
23 A, A, A, A, A, A, A, A, A, A, A, 0, 0, 0, 0, 0, /* 112..127 */
24 /* Nothing in the 128.. range */