diff options
| author | Andreas Schwab | 2008-03-16 10:45:53 +0000 |
|---|---|---|
| committer | Andreas Schwab | 2008-03-16 10:45:53 +0000 |
| commit | f50201817b3729dda94ce7bd0f7e2cb5371d0340 (patch) | |
| tree | 16446f78016d0157446ba9ab3bc5d496a161da2c /src | |
| parent | 7edd6b92deefa9e64ae0b5183ca121425b7e5f44 (diff) | |
| download | emacs-f50201817b3729dda94ce7bd0f7e2cb5371d0340.tar.gz emacs-f50201817b3729dda94ce7bd0f7e2cb5371d0340.zip | |
(re_match_2_internal): Correct matching of a charset
against latin-1 characters.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 5 | ||||
| -rw-r--r-- | src/regex.c | 15 |
2 files changed, 17 insertions, 3 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 687951808f3..2b7e7f8e3c3 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2008-03-16 Andreas Schwab <schwab@suse.de> | ||
| 2 | |||
| 3 | * regex.c (re_match_2_internal): Correct matching of a charset | ||
| 4 | against latin-1 characters. | ||
| 5 | |||
| 1 | 2008-03-16 Kenichi Handa <handa@m17n.org> | 6 | 2008-03-16 Kenichi Handa <handa@m17n.org> |
| 2 | 7 | ||
| 3 | * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY) | 8 | * coding.c (CHAR_STRING_ADVANCE_NO_UNIFY) |
diff --git a/src/regex.c b/src/regex.c index 1400a7daa77..9f2a42b4870 100644 --- a/src/regex.c +++ b/src/regex.c | |||
| @@ -5648,6 +5648,9 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop) | |||
| 5648 | in the initial byte-length of the command. */ | 5648 | in the initial byte-length of the command. */ |
| 5649 | int count = 0; | 5649 | int count = 0; |
| 5650 | 5650 | ||
| 5651 | /* Whether matching against a unibyte character. */ | ||
| 5652 | boolean unibyte_char = false; | ||
| 5653 | |||
| 5651 | DEBUG_PRINT2 ("EXECUTING charset%s.\n", not ? "_not" : ""); | 5654 | DEBUG_PRINT2 ("EXECUTING charset%s.\n", not ? "_not" : ""); |
| 5652 | 5655 | ||
| 5653 | range_table_exists = CHARSET_RANGE_TABLE_EXISTS_P (&p[-1]); | 5656 | range_table_exists = CHARSET_RANGE_TABLE_EXISTS_P (&p[-1]); |
| @@ -5667,7 +5670,10 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop) | |||
| 5667 | c = TRANSLATE (c); | 5670 | c = TRANSLATE (c); |
| 5668 | c1 = RE_CHAR_TO_UNIBYTE (c); | 5671 | c1 = RE_CHAR_TO_UNIBYTE (c); |
| 5669 | if (c1 >= 0) | 5672 | if (c1 >= 0) |
| 5670 | c = c1; | 5673 | { |
| 5674 | unibyte_char = true; | ||
| 5675 | c = c1; | ||
| 5676 | } | ||
| 5671 | } | 5677 | } |
| 5672 | else | 5678 | else |
| 5673 | { | 5679 | { |
| @@ -5678,11 +5684,14 @@ re_match_2_internal (bufp, string1, size1, string2, size2, pos, regs, stop) | |||
| 5678 | c1 = TRANSLATE (c1); | 5684 | c1 = TRANSLATE (c1); |
| 5679 | c1 = RE_CHAR_TO_UNIBYTE (c1); | 5685 | c1 = RE_CHAR_TO_UNIBYTE (c1); |
| 5680 | if (c1 >= 0) | 5686 | if (c1 >= 0) |
| 5681 | c = c1; | 5687 | { |
| 5688 | unibyte_char = true; | ||
| 5689 | c = c1; | ||
| 5690 | } | ||
| 5682 | } | 5691 | } |
| 5683 | } | 5692 | } |
| 5684 | 5693 | ||
| 5685 | if (c < (1 << BYTEWIDTH)) | 5694 | if (unibyte_char && c < (1 << BYTEWIDTH)) |
| 5686 | { /* Lookup bitmap. */ | 5695 | { /* Lookup bitmap. */ |
| 5687 | /* Cast to `unsigned' instead of `unsigned char' in | 5696 | /* Cast to `unsigned' instead of `unsigned char' in |
| 5688 | case the bit list is a full 32 bytes long. */ | 5697 | case the bit list is a full 32 bytes long. */ |