From owner-freebsd-current@FreeBSD.ORG Wed Oct 6 04:49:08 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 28581106566B for ; Wed, 6 Oct 2010 04:49:08 +0000 (UTC) (envelope-from kientzle@freebsd.org) Received: from monday.kientzle.com (99-115-135-74.uvs.sntcca.sbcglobal.net [99.115.135.74]) by mx1.freebsd.org (Postfix) with ESMTP id 7F5DA8FC13 for ; Wed, 6 Oct 2010 04:49:07 +0000 (UTC) Received: from [10.123.2.179] ([192.168.1.65]) by monday.kientzle.com (8.14.3/8.14.3) with ESMTP id o964VTUu001405; Wed, 6 Oct 2010 04:31:29 GMT (envelope-from kientzle@freebsd.org) Mime-Version: 1.0 (Apple Message framework v1081) Content-Type: text/plain; charset=us-ascii From: Tim Kientzle In-Reply-To: <20101005082723.GA2540@laptop.levsha.me> Date: Tue, 5 Oct 2010 21:31:29 -0700 Content-Transfer-Encoding: 7bit Message-Id: <18B9EF7D-BFBD-41D7-9BC8-46B52DF9D83C@freebsd.org> References: <20101005082723.GA2540@laptop.levsha.me> To: Mykola Dzham X-Mailer: Apple Mail (2.1081) Cc: freebsd-current@freebsd.org Subject: Re: bin/tar incorrectly parse '[^...]' patterns in --exclude X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Oct 2010 04:49:08 -0000 On Oct 5, 2010, at 1:27 AM, Mykola Dzham wrote: > Hi! > bsd tar parse only '[!...]' as negate pattern, but gnu tar and bsd tar > on 8-STABLE parse '[^...]' too: > > Fix: > > Index: usr.bin/tar/pathmatch.c > =================================================================== > --- usr.bin/tar/pathmatch.c (revision 212602) > +++ usr.bin/tar/pathmatch.c (working copy) > @@ -35,7 +35,7 @@ > > /* > * Check whether a character 'c' is matched by a list specification [...]: > - * * Leading '!' negates the class. > + * * Leading '!' or '^' negates the class. > * * - is a range of characters > * * \ removes any special meaning for > * > @@ -60,7 +60,7 @@ > (void)flags; /* UNUSED */ > > /* If this is a negated class, return success for nomatch. */ > - if (*p == '!' && p < end) { > + if ((*p == '!' || *p == '^') && p < end) { > match = 0; > nomatch = 1; > ++p; Thanks! Committed at r213469. Tim