|
Last change
on this file since 3670 was 3529, checked in by bird, 4 years ago |
|
Imported grep 3.7 from grep-3.7.tar.gz (sha256: c22b0cf2d4f6bbe599c902387e8058990e1eee99aef333a203829e5fd3dbb342), applying minimal auto-props.
|
-
Property svn:executable
set to
*
|
|
File size:
1.3 KB
|
| Line | |
|---|
| 1 | #!/bin/sh
|
|---|
| 2 | # Exercise a DFA range bug that arises only with a unibyte encoding
|
|---|
| 3 | # for which the wide-char-to-single-byte mapping is nontrivial.
|
|---|
| 4 | # E.g., the regexp, [C] would fail to match C in a unibyte locale like
|
|---|
| 5 | # ru_RU.KOI8-R for any C whose wide-char representation differed from
|
|---|
| 6 | # its single-byte equivalent.
|
|---|
| 7 |
|
|---|
| 8 | # Copyright (C) 2011-2021 Free Software Foundation, Inc.
|
|---|
| 9 |
|
|---|
| 10 | # This program is free software: you can redistribute it and/or modify
|
|---|
| 11 | # it under the terms of the GNU General Public License as published by
|
|---|
| 12 | # the Free Software Foundation, either version 3 of the License, or
|
|---|
| 13 | # (at your option) any later version.
|
|---|
| 14 |
|
|---|
| 15 | # This program is distributed in the hope that it will be useful,
|
|---|
| 16 | # but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|---|
| 17 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|---|
| 18 | # GNU General Public License for more details.
|
|---|
| 19 |
|
|---|
| 20 | # You should have received a copy of the GNU General Public License
|
|---|
| 21 | # along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|---|
| 22 |
|
|---|
| 23 | . "${srcdir=.}/init.sh"; path_prepend_ ../src
|
|---|
| 24 | require_ru_RU_koi8_r
|
|---|
| 25 | LC_ALL=ru_RU.KOI8-R
|
|---|
| 26 | export LC_ALL
|
|---|
| 27 |
|
|---|
| 28 | fail=0
|
|---|
| 29 |
|
|---|
| 30 | i=128
|
|---|
| 31 | while :; do
|
|---|
| 32 | in=in-$i
|
|---|
| 33 | octal=$(printf '%03o' $i)
|
|---|
| 34 | b=$(printf "\\$octal")
|
|---|
| 35 | echo "$b" > $in || framework_failure_
|
|---|
| 36 | grep "[$b]" $in > out || fail=1
|
|---|
| 37 | compare out $in || fail=1
|
|---|
| 38 |
|
|---|
| 39 | test $i = 255 && break
|
|---|
| 40 | i=$(expr $i + 1)
|
|---|
| 41 | done
|
|---|
| 42 |
|
|---|
| 43 | Exit $fail
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.