From owner-freebsd-rc@FreeBSD.ORG Sat Apr 23 21:58:54 2011 Return-Path: Delivered-To: freebsd-rc@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 425AF106564A; Sat, 23 Apr 2011 21:58:54 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay04.stack.nl [IPv6:2001:610:1108:5010::107]) by mx1.freebsd.org (Postfix) with ESMTP id CB1998FC08; Sat, 23 Apr 2011 21:58:53 +0000 (UTC) Received: from turtle.stack.nl (turtle.stack.nl [IPv6:2001:610:1108:5010::132]) by mx1.stack.nl (Postfix) with ESMTP id 342471DD649; Sat, 23 Apr 2011 23:58:53 +0200 (CEST) Received: by turtle.stack.nl (Postfix, from userid 1677) id 298491737B; Sat, 23 Apr 2011 23:58:53 +0200 (CEST) Date: Sat, 23 Apr 2011 23:58:53 +0200 From: Jilles Tjoelker To: Doug Barton Message-ID: <20110423215853.GA62363@stack.nl> References: <201012272253.oBRMrH7k025331@freefall.freebsd.org> <1232C1B4-DA64-4332-906E-288B8C1E39FE@gmail.com> <4D1A3DFE.8090009@FreeBSD.org> <4DACC455.4040603@FreeBSD.org> <20110421232840.GA29218@stack.nl> <4DB0D081.6090900@FreeBSD.org> <20110423104230.GA57811@stack.nl> <4DB2F853.3020202@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4DB2F853.3020202@FreeBSD.org> User-Agent: Mutt/1.5.21 (2010-09-15) Cc: Garrett Cooper , "freebsd-rc@FreeBSD.org" , "ggg_mail@inbox.ru" Subject: Re: MFCing sh(1) substitution changes (was: Finding $pidfile from a conf file) X-BeenThere: freebsd-rc@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Discussion related to /etc/rc.d design and implementation." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Apr 2011 21:58:54 -0000 On Sat, Apr 23, 2011 at 09:03:31AM -0700, Doug Barton wrote: > On 04/23/2011 03:42, Jilles Tjoelker wrote: > > On Thu, Apr 21, 2011 at 05:49:05PM -0700, Doug Barton wrote: > >> On 04/21/2011 16:28, Jilles Tjoelker wrote: > >>>> line="/${line%%[\"\;]*}" > > > >>> The meaning of this line depends on the version of sh(1). The correct > >>> interpretation, used by sh in 9-current and most other shells, is to > >>> strip from the first double-quote or semicolon onwards. However, sh in > >>> older FreeBSD versions will strip from the first backslash, double-quote > >>> or semicolon onwards. > > > >>> If the 9-current behaviour is desired for all FreeBSD versions, use: > >>> line=/${line%%[\"\;]*} > > > >> I think it's incredibly unlikely that there would actually be a > >> backslash in the text, and even if there was, it should be ok to strip > >> from there. > > > > Even if there is, it seems bad if this differs between 8.x and 9.x. > So MFC your changes. :) Hmm, I think that is a good reason not to MFC them, not a reason to MFC them. If you write something that differs between 8.x and 9.x, although it is very unlikely to have practical consequences, I can imagine that there are scripts where it actually matters and that will break with the 9.x behaviour. If so, I'd prefer that the breakage is noticed on a major FreeBSD version upgrade and not on a minor version upgrade. -- Jilles Tjoelker