public inbox for glibc-bugs-regex@sourceware.org help / color / mirror / Atom feed
From: "kimura dot koichi at canon dot co dot jp" <sourceware-bugzilla@sourceware.org> To: glibc-bugs-regex@sources.redhat.com Subject: [Bug regex/1149] character class with range doesn't match half-width kana in SJIS locale Date: Wed, 01 Feb 2006 04:48:00 -0000 [thread overview] Message-ID: <20060201044818.12780.qmail@sourceware.org> (raw) In-Reply-To: <20050802043748.1149.kimura.koichi@canon.co.jp> ------- Additional Comments From kimura dot koichi at canon dot co dot jp 2006-02-01 04:48 ------- (In reply to comment #2) I guess I found point of problem. Here is patch. --- regcomp.c.1~ 2005-07-18 11:51:43.000000000 +0900 +++ regcomp.c 2006-02-01 13:26:41.078750000 +0900 @@ -397,9 +397,13 @@ re_compile_fastmap_iter (bufp, init_stat } # else if (dfa->mb_cur_max > 1) - for (i = 0; i < SBC_MAX; ++i) - if (__btowc (i) == WEOF) - re_set_fastmap (fastmap, icase, i); + for (i = 0; i < SBC_MAX; ++i) { + wint_t wc; + wc = __btowc (i); + + if (wc == WEOF || wc >= SBC_MAX) + re_set_fastmap (fastmap, icase, i); + } # endif /* not _LIBC */ } for (i = 0; i < cset->nmbchars; ++i) --- regexec.c.1~ 2005-07-18 11:51:42.000000000 +0900 +++ regexec.c 2006-02-01 13:26:44.016250000 +0900 @@ -3715,6 +3715,7 @@ check_node_accept_bytes (dfa, node_idx, const re_token_t *node = dfa->nodes + node_idx; int char_len, elem_len; int i; + wchar_t wc; if (BE (node->type == OP_UTF8_PERIOD, 0)) { @@ -3784,7 +3785,8 @@ check_node_accept_bytes (dfa, node_idx, } elem_len = re_string_elem_size_at (input, str_idx); - if ((elem_len <= 1 && char_len <= 1) || char_len == 0) + wc = __btowc(*(input->mbs+str_idx)); + if ((elem_len <= 1 && char_len <= 1) || char_len == 0) && (wc != WEOF && wc < SBC_MAX)) return 0; if (node->type == COMPLEX_BRACKET) This patch is for non-_LIBC part since I could not follow the _LIBC part flow. -- http://sourceware.org/bugzilla/show_bug.cgi?id=1149 ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
next prev parent reply other threads:[~2006-02-01 4:48 UTC|newest] Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top 2005-08-02 4:37 [Bug regex/1149] New: " kimura dot koichi at canon dot co dot jp 2005-09-27 20:05 ` [Bug regex/1149] " drepper at redhat dot com 2006-01-27 6:00 ` kimura dot koichi at canon dot co dot jp 2006-02-01 4:48 ` kimura dot koichi at canon dot co dot jp [this message] 2006-04-25 18:12 ` drepper at redhat dot com 2006-04-26 7:04 ` bonzini at gnu dot org 2006-05-02 22:33 ` drepper at redhat dot com
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20060201044818.12780.qmail@sourceware.org \ --to=sourceware-bugzilla@sourceware.org \ --cc=glibc-bugs-regex@sources.redhat.com \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).