Version:
32bit 1.4.0 RC1
Issue:
TMerge causes a GPF when searching in a single pane mode.
Reproduction Recipe:
1. Create a text file containing one line of text
e.g. "Line1a" save it as base.txt
2. Modify the line e.g. change it to "Line1b", save it as mod.txt
3. Launch TMerge, select base.txt and mod.txt as the files
4. Change TMerge to single pane mode
5. Search for "1a" - 1a gets correctly highlighted
6. Click on Find again - TMerge GPF's
I checked out head (rev: 7239) and the same GPF occurs.
Cause:
In \src\TortoiseMerge\MainFrm.cpp OnEditFindnext there is a loop that
iterates around m_pwndLeftView->m_arDiffLines &
m_pwndRightView->m_arDiffLines, in a two pane view the vectors theses
point to are of the same length, in single pane mode all the diff lines
get appended to the left view and so the left view is longer than the
right. When the GetAt in line 1085 gets past the end of the vector it
causes a gpf.
The patch below stops this gpf by ignoring the rightview in single pane
mode.
An alternative solution is to clear the right pane pointer in LoadViews,
line 550ish. However it is not clear to me that this should be done in
LoadViews if reload is not true.
I've been wanting to contribute in some shape or form for ages so I hope
the above is of some use. I've been using TSVN for 18months or so and
am very pleased with it, keep up the great work guys!!
Regards
Jeremy Whitby
Patch below
Index: src/TortoiseMerge/MainFrm.cpp
===================================================================
--- src/TortoiseMerge/MainFrm.cpp (revision 7333)
+++ src/TortoiseMerge/MainFrm.cpp (working copy)
@@ -1080,7 +1080,7 @@
{
left = m_pwndLeftView->m_arDiffLines->GetAt(i);
leftstate =
(CDiffData::DiffStates)m_pwndLeftView->m_arLineStates->GetAt(i);
- if ((m_pwndRightView)&&(m_pwndRightView->m_arDiffLines))
+ if (!m_bOneWay &&
(m_pwndRightView)&&(m_pwndRightView->m_arDiffLines))
{
right = m_pwndRightView->m_arDiffLines->GetAt(i);
rightstate =
(CDiffData::DiffStates)m_pwndRightView->m_arLineStates->GetAt(i);
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tortoisesvn.tigris.org
For additional commands, e-mail: dev-help@tortoisesvn.tigris.org
Received on Sat Aug 26 21:39:46 2006