Reported-By: Mattia Rizzolo <mattia@debian.org> in #834629
/* Returns: the number of stanzas parsed*/
bool pkgSourceList::ParseFileDeb822(string const &File)
{
/* Returns: the number of stanzas parsed*/
bool pkgSourceList::ParseFileDeb822(string const &File)
{
// see if we can read the file
FileFd Fd(File, FileFd::ReadOnly);
pkgTagFile Sources(&Fd, pkgTagFile::SUPPORT_COMMENTS);
if (Fd.IsOpen() == false || Fd.Failed())
// see if we can read the file
FileFd Fd(File, FileFd::ReadOnly);
pkgTagFile Sources(&Fd, pkgTagFile::SUPPORT_COMMENTS);
if (Fd.IsOpen() == false || Fd.Failed())
- return _error->Error(_("Malformed stanza %u in source list %s (type)"),i,File.c_str());
+ return _error->Error(_("Malformed stanza %u in source list %s (type)"),0,File.c_str());
// read step by step
pkgTagSection Tags;
// read step by step
pkgTagSection Tags;
while (Sources.Step(Tags) == true)
{
while (Sources.Step(Tags) == true)
{
if(Tags.Exists("Types") == false)
return _error->Error(_("Malformed stanza %u in source list %s (type)"),i,File.c_str());
if(Tags.Exists("Types") == false)
return _error->Error(_("Malformed stanza %u in source list %s (type)"),i,File.c_str());
if (!Parse->ParseStanza(SrcList, Tags, i, Fd))
return false;
if (!Parse->ParseStanza(SrcList, Tags, i, Fd))
return false;