NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

bin/49422: patch(1) cannot handle context diffs



>Number:         49422
>Category:       bin
>Synopsis:       patch(1) cannot handle context diffs
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Nov 27 10:45:00 +0000 2014
>Originator:     Ryo ONODERA
>Release:        NetBSD 7.99.2
>Organization:
	
>Environment:
	
	
System: NetBSD angelcake.elements.tetera.org 7.99.2 NetBSD 7.99.2 (GENERIC) #0: Thu Nov 27 14:44:25 JST 2014 ryo_on%angelcake.elements.tetera.org@localhost:/usr/world/7.99/amd64/obj/sys/arch/amd64/compile/GENERIC amd64
Architecture: x86_64
Machine: amd64
>Description:
patch(1) from today's NetBSD current (7.99.2) cannot handle context diffs
anymore. For example, please build pkgsrc/shells/bash.

>How-To-Repeat:
Build pkgsrc/shells/bash under today's NetBSD current.

>Fix:
	
The following fixes my problem.
Index: pch.c
===================================================================
RCS file: /cvsroot/src/usr.bin/patch/pch.c,v
retrieving revision 1.26
diff -u -r1.26 pch.c
--- pch.c	26 Nov 2014 00:31:32 -0000	1.26
+++ pch.c	27 Nov 2014 10:37:11 -0000
@@ -619,8 +619,8 @@
 					p_ptrn_lines = 0;
 					p_first = 1;
 				}
-				if (p_first <= LINENUM_MAX - p_ptrn_lines ||
-				    p_ptrn_lines <= LINENUM_MAX - 6)
+				if (p_first >= LINENUM_MAX - p_ptrn_lines ||
+				    p_ptrn_lines >= LINENUM_MAX - 6)
 					malformed();
 
 				/* we need this much at least */

>Unformatted:
 	
 	


Home | Main Index | Thread Index | Old Index