From owner-freebsd-standards@FreeBSD.ORG Sun Mar 22 22:32:02 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 BA137106564A for ; Sun, 22 Mar 2009 22:32:02 +0000 (UTC) (envelope-from stefan@fafoe.narf.at) Received: from viefep16-int.chello.at (viefep16-int.chello.at [62.179.121.36]) by mx1.freebsd.org (Postfix) with ESMTP id F0A318FC13 for ; Sun, 22 Mar 2009 22:32:01 +0000 (UTC) (envelope-from stefan@fafoe.narf.at) Received: from edge01.upc.biz ([192.168.13.236]) by viefep18-int.chello.at (InterMail vM.7.09.01.00 201-2219-108-20080618) with ESMTP id <20090322221542.XKFP28039.viefep18-int.chello.at@edge01.upc.biz>; Sun, 22 Mar 2009 23:15:42 +0100 Received: from lizard.fafoe.narf.at ([213.47.85.26]) by edge01.upc.biz with edge id WNFh1b00l0a5KZh01NFi2A; Sun, 22 Mar 2009 23:15:42 +0100 X-SourceIP: 213.47.85.26 Received: by lizard.fafoe.narf.at (Postfix, from userid 1001) id 08498B9F2; Sun, 22 Mar 2009 23:15:40 +0100 (CET) Date: Sun, 22 Mar 2009 23:15:40 +0100 From: Stefan Farfeleder To: Jilles Tjoelker Message-ID: <20090322221540.GA1269@lizard.fafoe.narf.at> Mail-Followup-To: Jilles Tjoelker , Oliver Fromme , freebsd-standards@FreeBSD.ORG References: <200903181213.n2ICDPpT042350@lurza.secnetix.de> <200903191412.n2JECdbl011120@lurza.secnetix.de> <20090321214634.GA36395@stack.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20090321214634.GA36395@stack.nl> User-Agent: Mutt/1.5.17 (2007-11-01) Cc: freebsd-standards@FreeBSD.ORG, Oliver Fromme 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: Sun, 22 Mar 2009 22:32:03 -0000 On Sat, Mar 21, 2009 at 10:46:34PM +0100, 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.