[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Rename crash in TortoiseProc

From: Jeff Apple <japple_at_wispertel.net>
Date: 2005-11-13 08:37:42 CET

I tried renaming a file in the repository browser. While the caret is on
the name, I tried to horizontal scroll. This causes a crash. Various
other focus off events cause the crash as well. This should have been
fixed in revision 4096, but it seems not to have been.

I have enclosed a patch to fix this problem. It will also not attempt to
rename when the file name has not actually changed.

If this isn't the correct way to submit a patch, please let me know. I
really did look around for info on what to do and couldn't find anything.

Kavyboy

Index: src/TortoiseProc/RepositoryTree.cpp

===================================================================

--- src/TortoiseProc/RepositoryTree.cpp (revision 4924)

+++ src/TortoiseProc/RepositoryTree.cpp (working copy)

@@ -731,7 +731,10 @@

   {
           ATLTRACE("EndEdit\n");
           if ((lpnmrvie == NULL)||(lpnmrvie->lpszText == NULL))
+ {
                   CReportCtrl::EndEdit(FALSE, lpnmrvie);
+ return;
+ }
           
           HTREEITEM hItem = GetItemHandle(m_iEditItem);

@@ -740,7 +743,7 @@

           CString sNewName = lpnmrvie->lpszText;
           CString sNewUrl = sOldUrl.Left(sOldUrl.ReverseFind('/')+1) + sNewName;
           
- if ((!bUpdate)||(sNewName.FindOneOf(_T("/\\?*\"<>|"))>=0))
+ if
((!bUpdate)||(sNewName.FindOneOf(_T("/\\?*\"<>|"))>=0)||(sOldName==sNewName))
           {
                   CReportCtrl::EndEdit(FALSE, lpnmrvie);
                   return;

--

Index: src/TortoiseProc/RepositoryTree.cpp
===================================================================
--- src/TortoiseProc/RepositoryTree.cpp (revision 4924)
+++ src/TortoiseProc/RepositoryTree.cpp (working copy)
@@ -731,7 +731,10 @@
 {
         ATLTRACE("EndEdit\n");
         if ((lpnmrvie == NULL)||(lpnmrvie->lpszText == NULL))
+ {
                 CReportCtrl::EndEdit(FALSE, lpnmrvie);
+ return;
+ }
         
         HTREEITEM hItem = GetItemHandle(m_iEditItem);
 
@@ -740,7 +743,7 @@
         CString sNewName = lpnmrvie->lpszText;
         CString sNewUrl = sOldUrl.Left(sOldUrl.ReverseFind('/')+1) + sNewName;
         
- if ((!bUpdate)||(sNewName.FindOneOf(_T("/\\?*\"<>|"))>=0))
+ if ((!bUpdate)||(sNewName.FindOneOf(_T("/\\?*\"<>|"))>=0)||(sOldName==sNewName))
         {
                 CReportCtrl::EndEdit(FALSE, lpnmrvie);
                 return;

Received on Sun Nov 13 22:28:31 2005

This is an archived mail posted to the TortoiseSVN Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.