From owner-freebsd-current@FreeBSD.ORG Wed Oct 13 23:24:12 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 12FE7106564A for ; Wed, 13 Oct 2010 23:24:12 +0000 (UTC) (envelope-from obrien@NUXI.org) Received: from dragon.nuxi.org (trang.nuxi.org [74.95.12.85]) by mx1.freebsd.org (Postfix) with ESMTP id E6FA38FC13 for ; Wed, 13 Oct 2010 23:24:11 +0000 (UTC) Received: from dragon.nuxi.org (obrien@localhost [127.0.0.1]) by dragon.nuxi.org (8.14.4/8.14.4) with ESMTP id o9DNOBWH018493; Wed, 13 Oct 2010 16:24:11 -0700 (PDT) (envelope-from obrien@dragon.nuxi.org) Received: (from obrien@localhost) by dragon.nuxi.org (8.14.4/8.14.4/Submit) id o9DNOBqq018492; Wed, 13 Oct 2010 16:24:11 -0700 (PDT) (envelope-from obrien) Date: Wed, 13 Oct 2010 16:24:11 -0700 From: "David O'Brien" To: Jilles Tjoelker Message-ID: <20101013232411.GC17164@dragon.NUXI.org> Mail-Followup-To: obrien@freebsd.org, Jilles Tjoelker , freebsd-current@freebsd.org References: <20101012021914.GA72371@dragon.NUXI.org> <20101013214247.GA36354@stack.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20101013214247.GA36354@stack.nl> X-Operating-System: FreeBSD 9.0-CURRENT X-to-the-FBI-CIA-and-NSA: HI! HOW YA DOIN? User-Agent: Mutt/1.5.16 (2007-06-09) Cc: freebsd-current@freebsd.org Subject: Re: [PATCH] fix shell bug in ${var%pattern} expansion X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: obrien@freebsd.org List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Oct 2010 23:24:12 -0000 On Wed, Oct 13, 2010 at 11:42:48PM +0200, Jilles Tjoelker wrote: > Style bug: > > +growstrstackblock(int n) { > The opening brace should be on its own line. Indeed. I'm surprised I did that. Thank you for catching it. > Your test is too fragile: it often fails to detect the bug. Calling like > sh -c '. expansion/trim4.0' > gives the correct output even with a buggy sh. I propose something like > this, or perhaps with an additional string comparison: I also like this test better. Thank you for the review. -- -- David (obrien@FreeBSD.org)