@@ -1153,67 +1153,7 @@ static inline size_t xsize_t(off_t len)
1153
1153
/* in ctype.c, for kwset users */
1154
1154
extern const unsigned char tolower_trans_tbl [256 ];
1155
1155
1156
- /* Sane ctype - no locale, and works with signed chars */
1157
- #undef isascii
1158
- #undef isspace
1159
- #undef isdigit
1160
- #undef isalpha
1161
- #undef isalnum
1162
- #undef isprint
1163
- #undef islower
1164
- #undef isupper
1165
- #undef tolower
1166
- #undef toupper
1167
- #undef iscntrl
1168
- #undef ispunct
1169
- #undef isxdigit
1170
-
1171
- extern const unsigned char sane_ctype [256 ];
1172
- extern const signed char hexval_table [256 ];
1173
- #define GIT_SPACE 0x01
1174
- #define GIT_DIGIT 0x02
1175
- #define GIT_ALPHA 0x04
1176
- #define GIT_GLOB_SPECIAL 0x08
1177
- #define GIT_REGEX_SPECIAL 0x10
1178
- #define GIT_PATHSPEC_MAGIC 0x20
1179
- #define GIT_CNTRL 0x40
1180
- #define GIT_PUNCT 0x80
1181
- #define sane_istest (x ,mask ) ((sane_ctype[(unsigned char)(x)] & (mask)) != 0)
1182
- #define isascii (x ) (((x) & ~0x7f) == 0)
1183
- #define isspace (x ) sane_istest(x,GIT_SPACE)
1184
- #define isdigit (x ) sane_istest(x,GIT_DIGIT)
1185
- #define isalpha (x ) sane_istest(x,GIT_ALPHA)
1186
- #define isalnum (x ) sane_istest(x,GIT_ALPHA | GIT_DIGIT)
1187
- #define isprint (x ) ((x) >= 0x20 && (x) <= 0x7e)
1188
- #define islower (x ) sane_iscase(x, 1)
1189
- #define isupper (x ) sane_iscase(x, 0)
1190
- #define is_glob_special (x ) sane_istest(x,GIT_GLOB_SPECIAL)
1191
- #define is_regex_special (x ) sane_istest(x,GIT_GLOB_SPECIAL | GIT_REGEX_SPECIAL)
1192
- #define iscntrl (x ) (sane_istest(x,GIT_CNTRL))
1193
- #define ispunct (x ) sane_istest(x, GIT_PUNCT | GIT_REGEX_SPECIAL | \
1194
- GIT_GLOB_SPECIAL | GIT_PATHSPEC_MAGIC)
1195
- #define isxdigit (x ) (hexval_table[(unsigned char)(x)] != -1)
1196
- #define tolower (x ) sane_case((unsigned char)(x), 0x20)
1197
- #define toupper (x ) sane_case((unsigned char)(x), 0)
1198
- #define is_pathspec_magic (x ) sane_istest(x,GIT_PATHSPEC_MAGIC)
1199
-
1200
- static inline int sane_case (int x , int high )
1201
- {
1202
- if (sane_istest (x , GIT_ALPHA ))
1203
- x = (x & ~0x20 ) | high ;
1204
- return x ;
1205
- }
1206
-
1207
- static inline int sane_iscase (int x , int is_lower )
1208
- {
1209
- if (!sane_istest (x , GIT_ALPHA ))
1210
- return 0 ;
1211
-
1212
- if (is_lower )
1213
- return (x & 0x20 ) != 0 ;
1214
- else
1215
- return (x & 0x20 ) == 0 ;
1216
- }
1156
+ #include "sane-ctype.h"
1217
1157
1218
1158
/*
1219
1159
* Like skip_prefix, but compare case-insensitively. Note that the comparison
0 commit comments