diff options
author | Roland Reichwein <mail@reichwein.it> | 2023-01-29 15:17:50 +0100 |
---|---|---|
committer | Roland Reichwein <mail@reichwein.it> | 2023-01-29 15:17:50 +0100 |
commit | b1fb4f3aa1ec29781d2e25b1a05fb70e143fd24d (patch) | |
tree | dde76c41fa7aaf8b8b7e036b72c9983590ae873d /diff.cpp | |
parent | fa0cfcee2c7494e5025f6fb51152352282cbc032 (diff) |
Diff bugfix
Diffstat (limited to 'diff.cpp')
-rw-r--r-- | diff.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -81,6 +81,16 @@ void Diff::create(const std::string& old_version, const std::string& new_version return; } + // re-adjust if search crossed + if (old_pos0 > old_pos1) { + old_pos0 = old_pos1; + new_pos0 = old_pos1; + } + if (new_pos0 > new_pos1) { + old_pos0 = new_pos1; + new_pos0 = new_pos1; + } + // insert in the middle if (old_pos0 == old_pos1) { m_pos0 = old_pos0; |