From owner-freebsd-current@FreeBSD.ORG Thu May 23 21:03:07 2013 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 4375E738 for ; Thu, 23 May 2013 21:03:07 +0000 (UTC) (envelope-from se@freebsd.org) Received: from nm24-vm1.bullet.mail.ird.yahoo.com (nm24-vm1.bullet.mail.ird.yahoo.com [212.82.109.192]) by mx1.freebsd.org (Postfix) with SMTP id 9A0E7105 for ; Thu, 23 May 2013 21:03:06 +0000 (UTC) Received: from [77.238.189.238] by nm24.bullet.mail.ird.yahoo.com with NNFMP; 23 May 2013 21:03:04 -0000 Received: from [46.228.39.89] by tm19.bullet.mail.ird.yahoo.com with NNFMP; 23 May 2013 21:03:04 -0000 Received: from [127.0.0.1] by smtp126.mail.ir2.yahoo.com with NNFMP; 23 May 2013 21:03:04 -0000 X-Yahoo-Newman-Id: 655811.36963.bm@smtp126.mail.ir2.yahoo.com X-Yahoo-Newman-Property: ymail-3 X-YMail-OSG: K.AKJxAVM1lsZVuWuHOnTVjtncxuJxts0o13GbVV9d5khwj sAlLCcMjJnvu.FOFDSZNdbMXuidQ.3BL9ME4h.B91nV9nUGoQBJuAnpgnnAQ .HoQegLr2tg4uaFYqOTYB73LU_pTYmPQjhrC3WssC0DwPk8OiG7U_5vMUX1J 6a3pRiOr8EdLpdVPZDLRfHpa_ITR6MHJCpt2Smq2TGU9QcQFSLBr15B.vNGO yriEo4nVttvNvyopyvwKLIGwOnYgyMey0XtF6RVO6YZbMjqqj.Z_C_KXR5er lTP4rNofaLws4G5TElzHwvWO6.4XETM2jN88tII0a7YvRQKXsqudlDjp08i2 IraTtpNat.Eu69WZb3lEPkjWoxTZ5y7Vjcd4yFCzPTA59MFw5.f5Yz7ET_cE PLlyINA9CEhhqGIo37ey81pu6SEdM6qPS21utqXW9FEQF4s8qkNRjvRJiTAa GGQ-- X-Yahoo-SMTP: iDf2N9.swBDAhYEh7VHfpgq0lnq. X-Rocket-Received: from [192.168.119.11] (se@87.158.30.123 with ) by smtp126.mail.ir2.yahoo.com with SMTP; 23 May 2013 21:03:04 +0000 UTC Message-ID: <519E83FF.6020107@freebsd.org> Date: Thu, 23 May 2013 23:02:55 +0200 From: Stefan Esser User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130509 Thunderbird/17.0.6 MIME-Version: 1.0 To: d@delphij.net Subject: Re: [PATCH] Analysis of bug in BSD patch References: <519DBC27.9030600@gmx.com> <519DF73E.40307@freebsd.org> <20130523130751.GA53009@StefanEsser.freebsd.org> <519E4E18.1060605@delphij.net> In-Reply-To: <519E4E18.1060605@delphij.net> X-Enigmail-Version: 1.5.1 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Mailman-Approved-At: Thu, 23 May 2013 21:44:17 +0000 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.14 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: Thu, 23 May 2013 21:03:07 -0000 Am 23.05.2013 19:12, schrieb Xin Li: >> The following patch fixes the behaviour and makes it compliant >> with both the man page and GNU patch: > >> Index: pch.c >> =================================================================== > >> > > --- pch.c (revision 250926) >> +++ pch.c (working copy) @@ -1537,10 +1537,16 @@ continue; if >> ((tmp = num_components(names[i].path)) > min_components) >> continue; - min_components = tmp; + if (tmp < min_components) { >> + min_components = tmp; + best = names[i].path; + } if ((tmp >> = strlen(basename(names[i].path))) > min_baselen) continue; - >> min_baselen = tmp; + if (tmp < min_baselen) { + min_baselen = >> tmp; + best = names[i].path; + } if ((tmp = >> strlen(names[i].path)) > min_len) continue; min_len = tmp; > >> Please review this patch - I'd like to commit it to HEAD if there >> are no objections. > > Sounds good to me, thanks for working on this! Committed to HEAD as r250943. AFAIK, the BSD patch has been MFCed to 9, but is not used by default. If there are no problems with this patch, I plan to MFC it at the end of June, unless there are objections. Regards, STefan