|
Last change
on this file since 2595 was 2595, checked in by bird, 12 years ago |
|
gnu grep version 2.12 (grep-2.12.tar.xz, md5sum=8d2f0346d08b13c18afb81f0e8aa1e2f)
|
|
File size:
734 bytes
|
| Line | |
|---|
| 1 | #!/bin/sh
|
|---|
| 2 | # test that matches starting in the middle of a multibyte char aren't rejected
|
|---|
| 3 | # too greedily.
|
|---|
| 4 | # Derived from https://savannah.gnu.org/bugs/?23814
|
|---|
| 5 | . "${srcdir=.}/init.sh"; path_prepend_ ../src
|
|---|
| 6 |
|
|---|
| 7 | # Add "." to PATH for the use of get-mb-cur-max.
|
|---|
| 8 | path_prepend_ .
|
|---|
| 9 |
|
|---|
| 10 | require_compiled_in_MB_support
|
|---|
| 11 |
|
|---|
| 12 | locale=ja_JP.EUC-JP
|
|---|
| 13 |
|
|---|
| 14 | make_input () {
|
|---|
| 15 | echo "$1" | tr AB '\244\263'
|
|---|
| 16 | }
|
|---|
| 17 |
|
|---|
| 18 | euc_grep () {
|
|---|
| 19 | pat=$(make_input "$1")
|
|---|
| 20 | LC_ALL=$locale grep "$pat"
|
|---|
| 21 | }
|
|---|
| 22 |
|
|---|
| 23 | case $(get-mb-cur-max $locale) in
|
|---|
| 24 | 2|3) ;;
|
|---|
| 25 | *) skip_ 'EUC-JP locale not found' ;;
|
|---|
| 26 | esac
|
|---|
| 27 |
|
|---|
| 28 | fail=0
|
|---|
| 29 |
|
|---|
| 30 | # Does EUC-JP work at all?
|
|---|
| 31 | make_input BABA |euc_grep AB && fail=1
|
|---|
| 32 |
|
|---|
| 33 | # Whole line rejected after matching in the middle of a multibyte char?
|
|---|
| 34 | make_input BABAAB |euc_grep AB || fail=1
|
|---|
| 35 |
|
|---|
| 36 | Exit $fail
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.