Date: Mon, 11 Mar 2002 22:50:01 -0800 (PST) From: "."@babolo.ru To: freebsd-bugs@FreeBSD.org Subject: Re: bin/35812: strings(1) does'n print russian characters Message-ID: <200203120650.g2C6o1J35469@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR bin/35812; it has been noted by GNATS.
From: "."@babolo.ru
To: gpr@nvnpp.vrn.ru
Cc: FreeBSD-gnats-submit@FreeBSD.ORG
Subject: Re: bin/35812: strings(1) does'n print russian characters
Date: Tue, 12 Mar 2002 09:56:27 +0300 (MSK)
Gennady Proskurin writes:
>
> >Number: 35812
> >Category: bin
> >Synopsis: strings(1) does'n print russian characters
> >Confidential: no
> >Severity: non-critical
> >Priority: low
> >Responsible: freebsd-bugs
> >State: open
> >Quarter:
> >Keywords:
> >Date-Required:
> >Class: sw-bug
> >Submitter-Id: current-users
> >Arrival-Date: Mon Mar 11 22:40:00 PST 2002
> >Closed-Date:
> >Last-Modified:
> >Originator: Gennady Proskurin
> >Release: FreeBSD 5.0-CURRENT i386
> >Organization:
> >Environment:
> System: FreeBSD gpr.nvnpp.lan 5.0-CURRENT FreeBSD 5.0-CURRENT #4: Mon Mar 11 09:59:59 MSK 2002 gpr@gpr.nvnpp.lan:/usr/obj/usr/src/sys/gpr i386
>
>
> >Description:
> strings(1) does'n print russian characters due to incorrect type cast.
>
> >How-To-Repeat:
> echo 'some russian chars' | strings
>
> >Fix:
>
> --- /usr/src/usr.bin/strings/strings.c.orig Tue Mar 12 09:16:05 2002
> +++ /usr/src/usr.bin/strings/strings.c Tue Mar 12 09:16:07 2002
> @@ -184,7 +184,7 @@
> else
> printf("%s", bfr);
> while ((ch = getch()) != EOF && ISSTR(ch))
> - putchar((char)ch);
> + putchar((unsigned char)ch);
> putchar('\n');
> }
> cnt = 0;
>
>
>
> >Release-Note:
> >Audit-Trail:
> >Unformatted:
One more place to patch. It is my patch I use about year:
--- usr.bin/strings/strings.c Mon Apr 23 02:38:13 2001
+++ usr.bin/strings/strings.c Wed Aug 22 05:05:04 2001
@@ -170,7 +170,7 @@
}
start:
for (cnt = 0; (ch = getch()) != EOF;) {
- if (ISSTR(ch)) {
+ if (ISSTR(ch) & 0xff) {
if (!cnt)
C = bfr;
*C++ = ch;
@@ -183,7 +183,7 @@
foff - minlen, (char *)bfr);
else
printf("%s", bfr);
- while ((ch = getch()) != EOF && ISSTR(ch))
+ while ((ch = getch()) != EOF && ISSTR(ch & 0xff))
putchar((char)ch);
putchar('\n');
}
--
@BABOLO http://links.ru/
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200203120650.g2C6o1J35469>
