Bug#192765: Additional Scan() return value issues found
Diff file attached, also includes original patch.
Shouldn't this kind of problem raise a type error?
Maybe this is a bug in G++ also?
Martin
Index: apt-inst/deb/debfile.cc
===================================================================
RCS file: /cvs/deity/apt/apt-inst/deb/debfile.cc,v
retrieving revision 1.3
diff -u -b -B -p -r1.3 debfile.cc
--- apt-inst/deb/debfile.cc 10 Feb 2003 00:36:12 -0000 1.3
+++ apt-inst/deb/debfile.cc 10 May 2003 10:15:08 -0000
@@ -239,8 +239,8 @@ bool debDebFile::MemControlExtract::Read
Control[Length] = '\n';
Control[Length+1] = '\n';
- if (Section.Scan(Control,Length+2) == false)
- return _error->Error(_("Unparsible control file"));
+ if (Section.Scan(Control,Length+2) != pkgTagSection::ScanSuccess)
+ return _error->Error(_("Unparseable control file"));
return true;
}
/*}}}*/
@@ -257,7 +257,7 @@ bool debDebFile::MemControlExtract::Take
Control[Length] = '\n';
Control[Length+1] = '\n';
- return Section.Scan(Control,Length+2);
+ return (Section.Scan(Control,Length+2) != pkgTagSection::ScanSuccess);
}
/*}}}*/
Index: cmdline/apt-cache.cc
===================================================================
RCS file: /cvs/deity/apt/cmdline/apt-cache.cc,v
retrieving revision 1.63
diff -u -b -B -p -r1.63 apt-cache.cc
--- cmdline/apt-cache.cc 27 Apr 2003 02:47:44 -0000 1.63
+++ cmdline/apt-cache.cc 10 May 2003 10:15:09 -0000
@@ -481,7 +481,7 @@ bool DumpAvail(CommandLine &Cmd)
pkgTagSection Tags;
TFRewriteData RW[] = {{"Status",0},{"Config-Version",0},{}};
const char *Zero = 0;
- if (Tags.Scan(Buffer+Jitter,VF.Size+1) == false ||
+ if (Tags.Scan(Buffer+Jitter,VF.Size+1) != pkgTagSection::ScanSuccess ||
TFRewrite(stdout,Tags,&Zero,RW) == false)
{
_error->Error("Internal Error, Unable to parse a package record");
Index: cmdline/apt-sortpkgs.cc
===================================================================
RCS file: /cvs/deity/apt/cmdline/apt-sortpkgs.cc,v
retrieving revision 1.5
diff -u -b -B -p -r1.5 apt-sortpkgs.cc
--- cmdline/apt-sortpkgs.cc 11 Jan 2003 07:18:44 -0000 1.5
+++ cmdline/apt-sortpkgs.cc 10 May 2003 10:15:10 -0000
@@ -116,7 +116,7 @@ bool DoIt(string InFile)
}
Buffer[I->Length] = '\n';
- if (Section.Scan((char *)Buffer,I->Length+1) == false)
+ if (Section.Scan((char *)Buffer,I->Length+1) != pkgTagSection::ScanSuccess)
{
delete [] Buffer;
return _error->Error("Internal error, failed to scan buffer");
Index: ftparchive/writer.cc
===================================================================
RCS file: /cvs/deity/apt/ftparchive/writer.cc,v
retrieving revision 1.7
diff -u -b -B -p -r1.7 writer.cc
--- ftparchive/writer.cc 10 Feb 2003 07:34:41 -0000 1.7
+++ ftparchive/writer.cc 10 May 2003 10:15:10 -0000
@@ -525,7 +525,7 @@ bool SourcesWriter::DoPackage(string Fil
do
{
unsigned Pos;
- if (Tags.Scan(Start,BlkEnd - Start) == false)
+ if (Tags.Scan(Start,BlkEnd - Start) != pkgTagSection::ScanSuccess)
return _error->Error("Could not find a record in the DSC '%s'",FileName.c_str());
if (Tags.Find("Source",Pos) == true)
break;
Reply to: