From owner-freebsd-bugs Thu Feb 28 10:40:13 2002 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.FreeBSD.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 59CDB37B405 for ; Thu, 28 Feb 2002 10:40:01 -0800 (PST) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.6/8.11.6) id g1SIe1q91828; Thu, 28 Feb 2002 10:40:01 -0800 (PST) (envelope-from gnats) Received: from h132-197-179-27.gte.com (h132-197-179-27.gte.com [132.197.179.27]) by hub.freebsd.org (Postfix) with ESMTP id B4F8637B417; Thu, 28 Feb 2002 10:30:10 -0800 (PST) Received: from kanpc.gte.com (localhost [IPv6:::1]) by h132-197-179-27.gte.com (8.12.2/8.12.2) with ESMTP id g1SIU9P1002497; Thu, 28 Feb 2002 13:30:10 -0500 (EST) (envelope-from ak03@kanpc.gte.com) Received: (from ak03@localhost) by kanpc.gte.com (8.12.2/8.12.2/Submit) id g1SIU9Xv002496; Thu, 28 Feb 2002 13:30:09 -0500 (EST) Message-Id: <200202281830.g1SIU9Xv002496@kanpc.gte.com> Date: Thu, 28 Feb 2002 13:30:09 -0500 (EST) From: "Alexander N. Kabaev" Reply-To: "Alexander N. Kabaev" To: FreeBSD-gnats-submit@freebsd.org Cc: markm@freebsd.org X-Send-Pr-Version: 3.113 Subject: bin/35421: WARNS=4 fixes broke ls for 8-bit locales Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 35421 >Category: bin >Synopsis: WARNS=4 fixes broke ls for 8-bit locales >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu Feb 28 10:40:01 PST 2002 >Closed-Date: >Last-Modified: >Originator: Alexander N. Kabaev >Release: FreeBSD 5.0-CURRENT i386 >Organization: Verizon Data Services >Environment: System: FreeBSD kanpc.gte.com 5.0-CURRENT FreeBSD 5.0-CURRENT #3: Thu Feb 28 10:22:51 EST 2002 root@kanpc.gte.com:/usr/src/sys/i386/compile/KANPC i386 >Description: The revision 1.27 of src/bin/ls/util.c contains incorrent removal of the 'unsigned' attribute from the local char c varibale in prn_printable function. This causes chars with eith bit set to be promoted to negative int in isprint call, which in turn makes it non-printable as far as isprint function is concerned. This sequence effectively causes all russian file names to be printed as a sequence of '?' characters. >How-To-Repeat: ls in directory with any names in single-byte non-Latin1 encoding >Fix: Index: util.c =================================================================== RCS file: /usr/ncvs/src/bin/ls/util.c,v retrieving revision 1.28 diff -u -r1.28 util.c --- util.c 3 Feb 2002 20:55:54 -0000 1.28 +++ util.c 28 Feb 2002 18:18:16 -0000 @@ -60,10 +60,10 @@ int prn_printable(const char *s) { - char c; + unsigned char c; int n; - for (n = 0; (c = *s) != '\0'; ++s, ++n) + for (n = 0; (c = (unsigned char)*s) != '\0'; ++s, ++n) if (isprint(c)) putchar(c); else >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message