Patch #900 2006-03-06 11:13

dermeister

Fix for bug #6665 (Hang up with search function)
Download
900-Fix_for_bug_666.patch (643 bytes)
Category
Application::Bugfix
Status
Closed
Close date
2006-03-06 22:59
Assigned to
 
Index: src/sdk/editormanager.cpp
===================================================================
--- src/sdk/editormanager.cpp   (revision 2137)
+++ src/sdk/editormanager.cpp   (working copy)
@@ -1154,6 +1154,14 @@
         return -2;
     }
 
+    // Don't look for empty strings:
+       if (dlg->GetFindString().empty())
+       {
+               delete dlg;
+               cbMessageBox(_("Can't look for an empty search criterion!"), _("Error"), wxOK | wxICON_EXCLAMATION, Manager::Get()->GetAppWindow());
+               return -2;
+       }
+
     if (!m_LastFindReplaceData)
         m_LastFindReplaceData = new cbFindReplaceData;
killerbot 2006-03-06 22:59

I have just tested this, and this fixes the problem.

I also noticed, in case you don't choose "whole word" the crash does not happen. I wonder if in case of "whole word" we could end up at the crash through other paths ?

But this fix seems nevertheless a good addition, it can't harm to tell the user he's searching/replacing nothing.