1455 |
{ |
{ |
1456 |
const unsigned char *class_beg = str + i_byte + 1; |
const unsigned char *class_beg = str + i_byte + 1; |
1457 |
const unsigned char *class_end = class_beg; |
const unsigned char *class_end = class_beg; |
1458 |
const unsigned char *class_limit = str + size_byte; |
const unsigned char *class_limit = str + size_byte - 2; |
1459 |
/* Leave room for the null. */ |
/* Leave room for the null. */ |
1460 |
unsigned char class_name[CHAR_CLASS_MAX_LENGTH + 1]; |
unsigned char class_name[CHAR_CLASS_MAX_LENGTH + 1]; |
1461 |
re_wctype_t cc; |
re_wctype_t cc; |
1463 |
if (class_limit - class_beg > CHAR_CLASS_MAX_LENGTH) |
if (class_limit - class_beg > CHAR_CLASS_MAX_LENGTH) |
1464 |
class_limit = class_beg + CHAR_CLASS_MAX_LENGTH; |
class_limit = class_beg + CHAR_CLASS_MAX_LENGTH; |
1465 |
|
|
1466 |
while (class_end != class_limit |
while (class_end < class_limit |
1467 |
&& ! (*class_end >= 0200 |
&& *class_end >= 'a' && *class_end <= 'z') |
|
|| *class_end <= 040 |
|
|
|| (*class_end == ':' |
|
|
&& class_end[1] == ']'))) |
|
1468 |
class_end++; |
class_end++; |
1469 |
|
|
1470 |
if (class_end == class_limit |
if (class_end == class_beg |
1471 |
|| *class_end >= 0200 |
|| *class_end != ':' || class_end[1] != ']') |
1472 |
|| *class_end <= 040) |
goto not_a_class_name; |
|
error ("Invalid ISO C character class"); |
|
1473 |
|
|
1474 |
bcopy (class_beg, class_name, class_end - class_beg); |
bcopy (class_beg, class_name, class_end - class_beg); |
1475 |
class_name[class_end - class_beg] = 0; |
class_name[class_end - class_beg] = 0; |
1484 |
continue; |
continue; |
1485 |
} |
} |
1486 |
|
|
1487 |
|
not_a_class_name: |
1488 |
if (c == '\\') |
if (c == '\\') |
1489 |
{ |
{ |
1490 |
if (i_byte == size_byte) |
if (i_byte == size_byte) |