[PATCH] Analysis of bug in BSD patch

Stefan Esser se at freebsd.org
Thu May 23 21:03:07 UTC 2013


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


More information about the freebsd-current mailing list