From owner-freebsd-standards@FreeBSD.ORG Tue Mar 24 10:55:57 2009 Return-Path: Delivered-To: freebsd-standards@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CA1F81065675 for ; Tue, 24 Mar 2009 10:55:57 +0000 (UTC) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (lurza.secnetix.de [IPv6:2a01:170:102f::2]) by mx1.freebsd.org (Postfix) with ESMTP id 48A998FC1C for ; Tue, 24 Mar 2009 10:55:57 +0000 (UTC) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (localhost [127.0.0.1]) by lurza.secnetix.de (8.14.3/8.14.3) with ESMTP id n2OAtRZ3035648; Tue, 24 Mar 2009 11:55:54 +0100 (CET) (envelope-from oliver.fromme@secnetix.de) Received: (from olli@localhost) by lurza.secnetix.de (8.14.3/8.14.3/Submit) id n2OAtQKr035646; Tue, 24 Mar 2009 11:55:26 +0100 (CET) (envelope-from olli) From: Oliver Fromme Message-Id: <200903241055.n2OAtQKr035646@lurza.secnetix.de> To: stefan@fafoe.narf.at (Stefan Farfeleder) Date: Tue, 24 Mar 2009 11:55:26 +0100 (CET) In-Reply-To: <20090322221540.GA1269@lizard.fafoe.narf.at> X-Mailer: ELM [version 2.5 PL8] MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.1.2 (lurza.secnetix.de [127.0.0.1]); Tue, 24 Mar 2009 11:55:54 +0100 (CET) Cc: freebsd-standards@FreeBSD.ORG, Jilles Tjoelker Subject: Re: Suspecting bug in /bin/sh's IFS X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 24 Mar 2009 10:55:58 -0000 Stefan Farfeleder wrote: > Jilles Tjoelker wrote: > > The code is wrong, but your patched code is also wrong. The read builtin > > should use the same logic as normal field splitting, with additional > > rules if there are more fields in the input than variables. > > > > I have noticed that NetBSD has already fixed this. I have ported these > > fixes over: http://www.stack.nl/~jilles/unix/sh-read-split.patch > > The patch is against RELENG_7, I hope it applies to -CURRENT as well. > > > > The NetBSD commit message also refers to > > http://www.research.att.com/~gsf/public/ifs.sh > > Just like their /bin/sh, our /bin/sh with the patch now passes the > > 'read' tests from there (there are still many other failures though). > > > > By the way, to avoid all processing by read, one must IFS= read -r VAR. > > Without the IFS specification, leading and trailing whitespace will > > still be stripped. > > Thank you, I have committed this patch. Cool, thanks! -- Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing b. M. Handelsregister: Registergericht Muenchen, HRA 74606, Geschäftsfuehrung: secnetix Verwaltungsgesellsch. mbH, Handelsregister: Registergericht Mün- chen, HRB 125758, Geschäftsführer: Maik Bachmann, Olaf Erb, Ralf Gebhart FreeBSD-Dienstleistungen, -Produkte und mehr: http://www.secnetix.de/bsd "A misleading benchmark test can accomplish in minutes what years of good engineering can never do." -- Dilbert (2009-03-02)