// -*- mode: cpp; mode: fold -*-
// Description /*{{{*/
-// $Id: writer.cc,v 1.11 2004/01/02 21:48:13 mdz Exp $
+// $Id: writer.cc,v 1.14 2004/03/24 01:40:43 mdz Exp $
/* ######################################################################
Writer
Db(DB),Stats(Db.Stats)
{
Output = stdout;
+ SetExts(".deb .udeb .foo .bar .baz");
AddPattern("*.deb");
DeLinkLimit = 0;
{
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;
// Lookup the overide information, finding first the best priority.
string BestPrio;
- char Buffer[1000];
string Bins = Tags.FindS("Binary");
+ char Buffer[Bins.length() + 1];
Override::Item *OverItem = 0;
- if (Bins.empty() == false && Bins.length() < sizeof(Buffer))
+ if (Bins.empty() == false)
{
strcpy(Buffer,Bins.c_str());
{
NewFileName = string(FileName.begin() + DirStrip.length(),FileName.end());
while (NewFileName[0] == '/')
- NewFileName = string(FileName.begin() + 1,FileName.end());
+ NewFileName = string(NewFileName.begin() + 1,NewFileName.end());
}
else
NewFileName = FileName;