summaryrefslogtreecommitdiff
path: root/ftparchive
diff options
context:
space:
mode:
authorArch Librarian <arch@canonical.com>2004-09-20 17:04:41 +0000
committerArch Librarian <arch@canonical.com>2004-09-20 17:04:41 +0000
commitd6689735f2f19c2f9b551096963c7daf72e0dbb2 (patch)
treebaff7cdfcb418cf3f5d331c5f22806f8a51bce94 /ftparchive
parent9202409d47a751e49cf783dc41471daee3b5f214 (diff)
* Fix Packages::Extensions support in apt-ftparchive ge...
Author: mdz Date: 2004-01-04 00:20:59 GMT * Fix Packages::Extensions support in apt-ftparchive generate (Closes: #225453)
Diffstat (limited to 'ftparchive')
-rw-r--r--ftparchive/writer.cc20
1 files changed, 13 insertions, 7 deletions
diff --git a/ftparchive/writer.cc b/ftparchive/writer.cc
index 5264f4c1f..bc03492f4 100644
--- a/ftparchive/writer.cc
+++ b/ftparchive/writer.cc
@@ -1,6 +1,6 @@
// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: writer.cc,v 1.12 2004/01/02 21:55:09 mdz Exp $
+// $Id: writer.cc,v 1.13 2004/01/04 00:20:59 mdz Exp $
/* ######################################################################
Writer
@@ -289,6 +289,7 @@ PackagesWriter::PackagesWriter(string DB,string Overrides,string ExtOverrides) :
Db(DB),Stats(Db.Stats)
{
Output = stdout;
+ SetExts(".deb .udeb .foo .bar .baz");
AddPattern("*.deb");
DeLinkLimit = 0;
@@ -319,15 +320,20 @@ bool FTWScanner::SetExts(string Vals)
{
ClearPatterns();
string::size_type Start = 0;
- for(string::size_type space = Vals.find(' ');
- space != string::npos;
- space = Vals.find(' ', space))
+ while (Start <= Vals.length()-1)
{
- if (space > 0)
+ string::size_type Space = Vals.find(' ',Start);
+ string::size_type Length;
+ if (Space == string::npos)
{
- AddPattern(string("*") + string(Start, space-1));
- Start = space + 1;
+ Length = Vals.length()-Start;
}
+ else
+ {
+ Length = Space-Start;
+ }
+ AddPattern(string("*") + Vals.substr(Start, Length));
+ Start += Length + 1;
}
return true;