Browse Source
Do our own ctype.h, just to get the sane semantics: we want locale-independence, _and_ we want the right signed behaviour. Plus we only use a very small subset of ctype.h anyway (isspace, isalpha, isdigit and isalnum). Signed-off-by: Junio C Hamano <junkio@cox.net>maint
Linus Torvalds
19 years ago
committed by
Junio C Hamano
16 changed files with 51 additions and 14 deletions
@ -0,0 +1,23 @@
@@ -0,0 +1,23 @@
|
||||
/* |
||||
* Sane locale-independent, ASCII ctype. |
||||
* |
||||
* No surprises, and works with signed and unsigned chars. |
||||
*/ |
||||
#include "cache.h" |
||||
|
||||
#define SS GIT_SPACE |
||||
#define AA GIT_ALPHA |
||||
#define DD GIT_DIGIT |
||||
|
||||
unsigned char sane_ctype[256] = { |
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, SS, SS, 0, 0, SS, 0, 0, /* 0-15 */ |
||||
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 16-15 */ |
||||
SS, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 32-15 */ |
||||
DD, DD, DD, DD, DD, DD, DD, DD, DD, DD, 0, 0, 0, 0, 0, 0, /* 48-15 */ |
||||
0, AA, AA, AA, AA, AA, AA, AA, AA, AA, AA, AA, AA, AA, AA, AA, /* 64-15 */ |
||||
AA, AA, AA, AA, AA, AA, AA, AA, AA, AA, AA, 0, 0, 0, 0, 0, /* 80-15 */ |
||||
0, AA, AA, AA, AA, AA, AA, AA, AA, AA, AA, AA, AA, AA, AA, AA, /* 96-15 */ |
||||
AA, AA, AA, AA, AA, AA, AA, AA, AA, AA, AA, 0, 0, 0, 0, 0, /* 112-15 */ |
||||
/* Nothing in the 128.. range */ |
||||
}; |
||||
|
Loading…
Reference in new issue