Skip to content

Commit

Permalink
Fix a crash problem when the Diff algorithm is set to something other…
Browse files Browse the repository at this point in the history
… than default and one file does not have an EOL of the last line and the other file has an EOL of the last line.
  • Loading branch information
sdottaka committed Oct 7, 2023
1 parent 614a627 commit 5701b36
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Src/xdiff_gnudiff_compat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,9 +182,13 @@ struct change * diff_2_files_xdiff (struct file_data filevec[], int* bin_status,
{
script = diff_2_buffers_xdiff(
filevec[0].prefix_end,
filevec[0].suffix_begin - filevec[0].prefix_end,
filevec[0].suffix_begin - filevec[0].prefix_end -
((filevec[0].suffix_begin == filevec[0].buffer + filevec[0].buffered_chars)
? filevec[0].missing_newline : 0),
filevec[1].prefix_end,
filevec[1].suffix_begin - filevec[1].prefix_end,
filevec[1].suffix_begin - filevec[1].prefix_end -
((filevec[1].suffix_begin == filevec[1].buffer + filevec[1].buffered_chars)
? filevec[1].missing_newline : 0),
xdl_flags);
if (bMoved_blocks_flag)
moved_block_analysis(&script, filevec);
Expand Down

0 comments on commit 5701b36

Please sign in to comment.