Blame SOURCES/patch-2.7.6-failed_assertion.patch

796689
commit 76e775847f4954b63dc72afe34d9d921c6688b31
796689
Author: Andreas Gruenbacher <agruen@gnu.org>
796689
Date:   Tue Jul 16 01:16:28 2019 +0200
796689
796689
    Fix failed assertion 'outstate->after_newline'
796689
    
796689
    The assertion triggers when the -o FILE option is used, more than one output
796689
    file is written into FILE, and one of those files (except the last one) ends in
796689
    the middle of a line.
796689
    * src/patch.c (main): Fix the case described above.
796689
796689
diff --git a/src/patch.c b/src/patch.c
796689
index 02fd982..3794319 100644
796689
--- a/src/patch.c
796689
+++ b/src/patch.c
796689
@@ -369,6 +369,13 @@ main (int argc, char **argv)
796689
 	    /* outstate.ofp now owns the file descriptor */
796689
 	    outfd = -1;
796689
 	  }
796689
+	else
796689
+	  {
796689
+	    /* When writing to a single output file (-o FILE), always pretend
796689
+	       that the output file ends in a newline.  Otherwise, when another
796689
+	       file is written to the same output file, apply_hunk will fail.  */
796689
+	    outstate.after_newline = true;
796689
+	  }
796689
 
796689
 	/* find out where all the lines are */
796689
 	if (!skip_rest_of_patch) {