Date: Tue, 28 Sep 1999 15:56:40 +0800 (TSD) From: tolik@mpeks.tomsk.su To: FreeBSD-gnats-submit@freebsd.org Subject: gnu/14011: Unpredictable grep(1) output for 8-bit characters Message-ID: <199909280756.PAA28332@sibptus.tomsk.ru>
index | next in thread | raw e-mail
>Number: 14011
>Category: gnu
>Synopsis: grep(1) returned unpredictable output for 8-bit characters
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: freebsd-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Tue Sep 28 01:00:00 PDT 1999
>Closed-Date:
>Last-Modified:
>Originator: Anatoly A. Orehovsky
>Release: FreeBSD 2.2.8-RELEASE i386 and others
>Organization:
SibPTUS
>Environment:
FreeBSD box where russian (for example) locale is set.
>Description:
If you wanted to search simple russian phrase with grep(1),
then grep(1) returned unpredictable output.
>How-To-Repeat:
$ export LANG=ru_RU.KOI8-R
$ echo '27 ΣΕΞ' | grep '27 ΣΕΞ' # search '27 Sep' by russian
and grep's output is nothing
If input file contain many strings '27 ΣΕΞ', then grep returned
unpredictable output or nothing.
>Fix:
Workaround:
Using grep's -i option (if case sensitive not needed):
$ export LANG=ru_RU.KOI8-R
$ echo '27 ΣΕΞ' | grep -i '27 ΣΕΞ'
27 ΣΕΞ
Patch to fix problem:
patch.092899:
--- grep/kwset.c.orig Tue Sep 28 15:19:49 1999
+++ grep/kwset.c Tue Sep 28 15:20:42 1999
@@ -527,7 +527,7 @@
{
struct kwset *kwset;
register unsigned char *d1;
- register char *ep, *sp, *tp;
+ register unsigned char *ep, *sp, *tp;
register int d, gc, i, len, md2;
kwset = (struct kwset *) kws;
__
Anatoly A. Orehovsky. AO9-RIPE. AAO1-RIPN
http://www.tekmetrics.com/transcript.shtml?pid=6064
>Release-Note:
>Audit-Trail:
>Unformatted:
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message
help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199909280756.PAA28332>
