Commit 78d7f09f by Tom de Vries Committed by Tom de Vries

Fix patch mangling with --inline option

2014-11-14  Tom de Vries  <tom@codesourcery.com>

	* mklog: Move reading of .diff file up and add comment.  Copy diff_lines
	to orig_diff_lines.  Use orig_diff_lines when appending patch.

From-SVN: r217558
parent cbe4c88c
2014-11-14 Tom de Vries <tom@codesourcery.com>
* mklog: Move reading of .diff file up and add comment. Copy diff_lines
to orig_diff_lines. Use orig_diff_lines when appending patch.
2014-11-11 David Malcolm <dmalcolm@redhat.com>
* ChangeLog.jit: New.
......
......@@ -132,15 +132,23 @@ sub is_top_level {
return $function && $function !~ /^[\s{]/;
}
# Read contents of .diff file
open (DFILE, $diff) or die "Could not open file $diff for reading";
chomp (my @diff_lines = <DFILE>);
close (DFILE);
# Array diff_lines is modified by the log generation, so save a copy in
# orig_diff_lines if needed.
if ($inline) {
@orig_diff_lines = @diff_lines;
}
# For every file in the .diff print all the function names in ChangeLog
# format.
%cl_entries = ();
$change_msg = undef;
$look_for_funs = 0;
$clname = get_clname('');
open (DFILE, $diff) or die "Could not open file $diff for reading";
chomp (my @diff_lines = <DFILE>);
close (DFILE);
$line_idx = 0;
foreach (@diff_lines) {
# Stop processing functions if we found a new file.
......@@ -313,7 +321,7 @@ foreach my $clname (keys %cl_entries) {
if ($inline) {
# Append the patch to the log
foreach (@diff_lines) {
foreach (@orig_diff_lines) {
print OUTPUTFILE "$_\n";
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment