MFCing sh(1) substitution changes (was: Finding $pidfile from a conf file)

Jilles Tjoelker jilles at stack.nl
Sat Apr 23 21:58:54 UTC 2011


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


More information about the freebsd-rc mailing list