This is the mail archive of the libc-hacker@sources.redhat.com mailing list for the glibc project.
Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Hi! I believe I had trouble to reproduce it because I probably missed -DMBS_SUPPORT when building regex.o by hand or whatever. The issue is that regex was badly inconsistent in translating, PATFETCH used to translate even wchar_ts below and equal to '\xff' while TRANSLATE only translated chars, so in the testcase start_range_char was translated while range_end was not (because sizeof(p[0]) > 1) - I wondered why even at -O0 start_range variable does not exist on ia64 in the debugger and the reason seems it was an alias for start_range_char. Are there any regression tests for regex's in other packages (I mean sed, awk, perl, whatever)? ksymoops stresses regex quite badly, so that could be a good test as well. 2001-02-15 Jakub Jelinek <jakub@redhat.com> * posix/regex.c (init_syntax_once): Add prototype. (TRANSLATE): If MBS_SUPPORT, translate all characters up to '\xff'. (re_search_2): Avoid warning. (count_mbs_length): Add prototype. --- libc/posix/regex.c.jj Sat Feb 10 02:56:10 2001 +++ libc/posix/regex.c Thu Feb 15 15:53:17 2001 @@ -290,6 +290,8 @@ extern char *re_syntax_table; static char re_syntax_table[CHAR_SET_SIZE]; +static void init_syntax_once PARAMS ((void)); + static void init_syntax_once () { @@ -1906,7 +1908,8 @@ static reg_errcode_t compile_range _RE_A #ifndef TRANSLATE # ifdef MBS_SUPPORT # define TRANSLATE(d) \ - (translate && (sizeof(d) <= 1)? (char) translate[(unsigned char) (d)] : (d)) + ((translate && ((US_CHAR_TYPE) (d)) <= 0xff) \ + ? (char) translate[(unsigned char) (d)] : (d)) #else # define TRANSLATE(d) \ (translate ? (char) translate[(unsigned char) (d)] : (d)) @@ -5058,9 +5061,9 @@ re_search_2 (bufp, string1, size1, strin } else /* Searching backwards. */ { - register char c = (size1 == 0 || startpos >= size1 - ? string2[startpos - size1] - : string1[startpos]); + register CHAR_TYPE c = (size1 == 0 || startpos >= size1 + ? string2[startpos - size1] + : string1[startpos]); if (!fastmap[(unsigned char) TRANSLATE (c)]) goto advance; @@ -5309,10 +5312,14 @@ weak_alias (__re_match_2, re_match_2) #endif #ifdef MBS_SUPPORT + +static int count_mbs_length PARAMS ((int *, int)); + /* This check the substring (from 0, to length) of the multibyte string, to which offset_buffer correspond. And count how many wchar_t_characters the substring occupy. We use offset_buffer to optimization. See convert_mbs_to_wcs. */ + static int count_mbs_length(offset_buffer, length) int *offset_buffer; Jakub
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |