comparison src/regex.c @ 32804:45c2b9e0aa68

(regex_compile): Change the way of handling a range from a char less than 256 to a char not less than 256.
author Kenichi Handa <handa@m17n.org>
date Tue, 24 Oct 2000 08:10:27 +0000
parents 37d5eb3558fb
children 112b31ea0526
comparison
equal deleted inserted replaced
32803:0c258c67cf54 32804:45c2b9e0aa68
2596 2596
2597 if (SINGLE_BYTE_CHAR_P (c)) 2597 if (SINGLE_BYTE_CHAR_P (c))
2598 { 2598 {
2599 if (! SINGLE_BYTE_CHAR_P (c1)) 2599 if (! SINGLE_BYTE_CHAR_P (c1))
2600 { 2600 {
2601 /* Handle a range such as \177-\377 in 2601 /* Handle a range starting with a
2602 multibyte mode. Split that into two 2602 character of less than 256, and ending
2603 ranges, the low one ending at 0237, and 2603 with a character of not less than 256.
2604 the high one starting at the smallest 2604 Split that into two ranges, the low one
2605 character in the charset of C1 and 2605 ending at 0377, and the high one
2606 ending at C1. */ 2606 starting at the smallest character in
2607 the charset of C1 and ending at C1. */
2607 int charset = CHAR_CHARSET (c1); 2608 int charset = CHAR_CHARSET (c1);
2608 int c2 = MAKE_CHAR (charset, 0, 0); 2609 int c2 = MAKE_CHAR (charset, 0, 0);
2609 2610
2610 SET_RANGE_TABLE_WORK_AREA (range_table_work, 2611 SET_RANGE_TABLE_WORK_AREA (range_table_work,
2611 c2, c1); 2612 c2, c1);
2612 c1 = 0237; 2613 c1 = 377;
2613 } 2614 }
2614 } 2615 }
2615 else if (!SAME_CHARSET_P (c, c1)) 2616 else if (!SAME_CHARSET_P (c, c1))
2616 FREE_STACK_RETURN (REG_ERANGE); 2617 FREE_STACK_RETURN (REG_ERANGE);
2617 } 2618 }