Update of /cvsroot/mahogany/M/src/util
In directory usw-pr-cvs1:/tmp/cvs-serv11375/src/util

Modified Files:
        matchurl.cpp 
Log Message:
- Corrected the destructor of KeywordDetectorCell, to correctly handle 
  the deletion of back-nodes (i.e. nothing to be done).
- Added '*' as not an URLchar
- Corrected the case when there is not a single URL to display in the
  message: it was not displayed at all.

Index: matchurl.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/util/matchurl.cpp,v
retrieving revision 1.8
retrieving revision 1.9
diff -b -u -2 -r1.8 -r1.9
--- matchurl.cpp        28 Apr 2002 20:29:38 -0000      1.8
+++ matchurl.cpp        29 Apr 2002 08:25:25 -0000      1.9
@@ -41,8 +41,10 @@
       _c(c), _son(NULL), _brother(NULL), _isKey(0), _back(NULL) {}
 
-  ~KeywordDetectorCell()
-  {
+   ~KeywordDetectorCell() {  
+      if (_c != '\000') {
      delete _son;
-     //delete _brother; -- this results in infinite recursion somehow
+         delete _brother;
+      } // else: this is a back-node, and thus it points up in the
+        // tree, to a node that is already deleted, or will soon be.
   }
 
@@ -67,5 +69,7 @@
 public:
   KeywordDetector() : _root(NULL) { }
-  ~KeywordDetector() { delete _root; }
+  ~KeywordDetector() { 
+     delete _root; 
+  }
 
 public:
@@ -364,5 +368,5 @@
    // an URL except for '>' which, together with '<' is often used for
    // delimiting the URLs
-   return IsAlnum(c) || !(iscntrl(c) || isspace(c) || c == '>' );
+   return IsAlnum(c) || !(iscntrl(c) || isspace(c) || c == '>' || c == '*');
 }
 
@@ -548,6 +552,6 @@
    {
       // no URLs found
-      before.swap(str);
-      url.clear();
+      str.swap(before);
+      str.clear();
    }
    else // found an URL


_______________________________________________
Mahogany-cvsupdates mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates

Reply via email to