Bug 14011

Summary: grep(1) returned unpredictable output for 8-bit characters
Product: Base System Reporter: tolik <tolik>
Component: gnuAssignee: ru <ru>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 2.2.8-RELEASE   
Hardware: Any   
OS: Any   

Description tolik 1999-09-28 09:00:00 UTC
	If you wanted to search simple russian phrase with grep(1),
	then grep(1) returned unpredictable output.

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:


__
Anatoly A. Orehovsky. AO9-RIPE. AAO1-RIPN
http://www.tekmetrics.com/transcript.shtml?pid=6064--WTIgoxpfCwhMzY8bRGoXrncnqoLA3GhCf7J8ecPM97GClp4s
Content-Type: text/plain; name="file.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename="file.diff"

--- 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;
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.
Comment 1 ru freebsd_committer freebsd_triage 1999-09-28 09:05:59 UTC
Responsible Changed
From-To: freebsd-bugs->wosch

Over to the maintainer. 
Comment 2 ru freebsd_committer freebsd_triage 1999-10-13 12:41:26 UTC
Responsible Changed
From-To: wosch->ru

Maintainer timeout. 
Comment 3 ru freebsd_committer freebsd_triage 1999-10-28 11:50:58 UTC
State Changed
From-To: open->closed

Fixed in both CURRENT and STABLE.