ctype.con commit fast-import: Improve robustness when D->F changes provided in wrong order (253fb5f)
   1/*
   2 * Sane locale-independent, ASCII ctype.
   3 *
   4 * No surprises, and works with signed and unsigned chars.
   5 */
   6#include "cache.h"
   7
   8enum {
   9        S = GIT_SPACE,
  10        A = GIT_ALPHA,
  11        D = GIT_DIGIT,
  12        G = GIT_GLOB_SPECIAL,   /* *, ?, [, \\ */
  13        R = GIT_REGEX_SPECIAL,  /* $, (, ), +, ., ^, {, | */
  14};
  15
  16unsigned char sane_ctype[256] = {
  17        0, 0, 0, 0, 0, 0, 0, 0, 0, S, S, 0, 0, S, 0, 0,         /*   0.. 15 */
  18        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,         /*  16.. 31 */
  19        S, 0, 0, 0, R, 0, 0, 0, R, R, G, R, 0, 0, R, 0,         /*  32.. 47 */
  20        D, D, D, D, D, D, D, D, D, D, 0, 0, 0, 0, 0, G,         /*  48.. 63 */
  21        0, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A,         /*  64.. 79 */
  22        A, A, A, A, A, A, A, A, A, A, A, G, G, 0, R, 0,         /*  80.. 95 */
  23        0, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A,         /*  96..111 */
  24        A, A, A, A, A, A, A, A, A, A, A, R, R, 0, 0, 0,         /* 112..127 */
  25        /* Nothing in the 128.. range */
  26};