Module Name:    src
Committed By:   christos
Date:           Thu Nov 27 15:07:23 UTC 2014

Modified Files:
        src/usr.bin/patch: pch.c

Log Message:
PR/49422: Ryo ONODERA: patch(1) cannot handle context diffs


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/usr.bin/patch/pch.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/usr.bin/patch/pch.c
diff -u src/usr.bin/patch/pch.c:1.26 src/usr.bin/patch/pch.c:1.27
--- src/usr.bin/patch/pch.c:1.26	Tue Nov 25 19:31:32 2014
+++ src/usr.bin/patch/pch.c	Thu Nov 27 10:07:23 2014
@@ -1,7 +1,7 @@
 /*
  * $OpenBSD: pch.c,v 1.37 2007/09/02 15:19:33 deraadt Exp $
  * $DragonFly: src/usr.bin/patch/pch.c,v 1.6 2008/08/10 23:35:40 joerg Exp $
- * $NetBSD: pch.c,v 1.26 2014/11/26 00:31:32 christos Exp $
+ * $NetBSD: pch.c,v 1.27 2014/11/27 15:07:23 christos Exp $
  */
 
 /*
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: pch.c,v 1.26 2014/11/26 00:31:32 christos Exp $");
+__RCSID("$NetBSD: pch.c,v 1.27 2014/11/27 15:07:23 christos Exp $");
 
 #include <sys/types.h>
 #include <sys/stat.h>
@@ -619,8 +619,8 @@ another_hunk(void)
 					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 */

Reply via email to