浏览代码

* apt-pkg/contrib/configuration.cc:
- fix double delete (LP: #848907)
- ignore only the invalid regexp instead of all options

Michael Vogt 15 年之前
父节点
当前提交
44edc41ea7
共有 2 个文件被更改,包括 8 次插入4 次删除
  1. 5 4
      apt-pkg/contrib/configuration.cc
  2. 3 0
      debian/changelog

+ 5 - 4
apt-pkg/contrib/configuration.cc

@@ -870,10 +870,10 @@ Configuration::MatchAgainstConfig::MatchAgainstConfig(char const * Config)
       {
       {
 	 regfree(p);
 	 regfree(p);
 	 delete p;
 	 delete p;
-	 clearPatterns();
-	 _error->Warning("Regex compilation error for '%s' in configuration option '%s'",
-				s->c_str(), Config);
-	 return;
+	 _error->Warning("Invalid regular expression '%s' in configuration "
+                         "option '%s' will be ignored.",
+                         s->c_str(), Config);
+	 continue;
       }
       }
    }
    }
    if (strings.size() == 0)
    if (strings.size() == 0)
@@ -894,6 +894,7 @@ void Configuration::MatchAgainstConfig::clearPatterns()
       regfree(*p);
       regfree(*p);
       delete *p;
       delete *p;
    }
    }
+   patterns.clear();
 }
 }
 									/*}}}*/
 									/*}}}*/
 // MatchAgainstConfig::Match - returns true if a pattern matches	/*{{{*/
 // MatchAgainstConfig::Match - returns true if a pattern matches	/*{{{*/

+ 3 - 0
debian/changelog

@@ -15,6 +15,9 @@ apt (0.8.16~exp5) experimental; urgency=low
   * methods/mirror.cc:
   * methods/mirror.cc:
     - include the architecture(s) in the query string as well so 
     - include the architecture(s) in the query string as well so 
       that the server can make better decisions
       that the server can make better decisions
+  * apt-pkg/contrib/configuration.cc:
+    - fix double delete (LP: #848907)
+    - ignore only the invalid regexp instead of all options
 
 
  -- Michael Vogt <mvo@debian.org>  Fri, 05 Aug 2011 10:57:08 +0200
  -- Michael Vogt <mvo@debian.org>  Fri, 05 Aug 2011 10:57:08 +0200