From aaee82939afca3f1c11da87d0c44d7c2b07b4c1d Mon Sep 17 00:00:00 2001
From: Arch Librarian <arch@canonical.com>
Date: Mon, 20 Sep 2004 16:54:55 +0000
Subject: [PATCH] Fixed for 0 length source files Author: jgg Date: 1999-10-18
 04:15:24 GMT Fixed for 0 length source files

---
 apt-pkg/deb/debsrcrecords.h | 5 ++---
 apt-pkg/srcrecords.cc       | 8 ++++----
 cmdline/apt-cache.cc        | 4 +++-
 3 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/apt-pkg/deb/debsrcrecords.h b/apt-pkg/deb/debsrcrecords.h
index e09a57f3c..50488d4b6 100644
--- a/apt-pkg/deb/debsrcrecords.h
+++ b/apt-pkg/deb/debsrcrecords.h
@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // Description								/*{{{*/
-// $Id: debsrcrecords.h,v 1.4 1999/10/18 03:44:39 jgg Exp $
+// $Id: debsrcrecords.h,v 1.5 1999/10/18 04:15:25 jgg Exp $
 /* ######################################################################
    
    Debian Source Package Records - Parser implementation for Debian style
@@ -38,10 +38,9 @@ class debSrcRecordParser : public pkgSrcRecords::Parser
    virtual string Section() {return Sect.FindS("Section");};
    virtual const char **Binaries();
    virtual unsigned long Offset() {return iOffset;};
-   virtual unsigned long Length() {return Sec.size();};
    virtual string AsStr() 
    {
-      const char *Start,Stop;
+      const char *Start=0,*Stop=0;
       Sect.GetSection(Start,Stop);
       return string(Start,Stop);
    };
diff --git a/apt-pkg/srcrecords.cc b/apt-pkg/srcrecords.cc
index 23d3a5fc0..6da902d98 100644
--- a/apt-pkg/srcrecords.cc
+++ b/apt-pkg/srcrecords.cc
@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // Description								/*{{{*/
-// $Id: srcrecords.cc,v 1.2 1999/04/07 05:30:18 jgg Exp $
+// $Id: srcrecords.cc,v 1.3 1999/10/18 04:15:24 jgg Exp $
 /* ######################################################################
    
    Source Package Records - Allows access to source package records
@@ -66,7 +66,7 @@ pkgSrcRecords::pkgSrcRecords(pkgSourceList &List) : Files(0), Current(0)
       Files[Count] = new debSrcRecordParser(FD,I);
       Count++;
    }
-   
+
    Restart();
 }
 									/*}}}*/
@@ -90,8 +90,8 @@ bool pkgSrcRecords::Restart()
 {
    Current = Files;
    for (Parser **I = Files; *I != 0; I++)
-      if ((*I)->Restart() == false)
-	 return false;
+      (*I)->Restart();
+   
    return true;
 }
 									/*}}}*/
diff --git a/cmdline/apt-cache.cc b/cmdline/apt-cache.cc
index 5bb9db7cc..8dc56a72b 100644
--- a/cmdline/apt-cache.cc
+++ b/cmdline/apt-cache.cc
@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // Description								/*{{{*/
-// $Id: apt-cache.cc,v 1.39 1999/10/18 03:44:39 jgg Exp $
+// $Id: apt-cache.cc,v 1.40 1999/10/18 04:15:25 jgg Exp $
 /* ######################################################################
    
    apt-cache - Manages the cache files
@@ -613,6 +613,8 @@ bool ShowSrcPackage(CommandLine &CmdL)
 
    for (const char **I = CmdL.FileList + 1; *I != 0; I++)
    {
+      SrcRecs.Restart();
+      
       pkgSrcRecords::Parser *Parse;
       while ((Parse = SrcRecs.Find(*I,false)) != 0)
 	 cout << Parse->AsStr();
-- 
2.47.2