[Aptitude-svn-commit] r3717 - branches/aptitude-0.3/aptitude/src/generic

Daniel Burrows dburrows at costa.debian.org
Sat Aug 6 17:55:54 UTC 2005


Author: dburrows
Date: Sat Aug  6 17:55:54 2005
New Revision: 3717

Modified:
   branches/aptitude-0.3/aptitude/src/generic/matchers.cc
Log:
Fix the NOT combinator for patterns.

Modified: branches/aptitude-0.3/aptitude/src/generic/matchers.cc
==============================================================================
--- branches/aptitude-0.3/aptitude/src/generic/matchers.cc	(original)
+++ branches/aptitude-0.3/aptitude/src/generic/matchers.cc	Sat Aug  6 17:55:54 2005
@@ -1093,11 +1093,19 @@
   }
 
   // Eh, there isn't really a good choice about what to return here...
-  // just return what the child does. :(
+  // just return an empty result if the child doesn't match.
   pkg_match_result *get_match(const pkgCache::PkgIterator &pkg,
 			      const pkgCache::VerIterator &ver)
   {
-    return child->get_match(pkg, ver);
+    pkg_match_result *child_match = child->get_match(pkg, ver);
+
+    if(child_match == NULL)
+      return new empty_match_result;
+    else
+      {
+	delete child_match;
+	return NULL;
+      }
   }
 
   ~pkg_not_matcher() {delete child;}



More information about the Aptitude-svn-commit mailing list