Bug fixes
[ntk/apt.git] / apt-pkg / sourcelist.cc
index c4f225f..48d32f9 100644 (file)
@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // Description                                                         /*{{{*/
-// $Id: sourcelist.cc,v 1.13 1999/04/07 05:30:17 jgg Exp $
+// $Id: sourcelist.cc,v 1.16 1999/09/30 06:30:34 jgg Exp $
 /* ######################################################################
 
    List of Sources
@@ -73,7 +73,7 @@ bool pkgSourceList::Read(string File)
       string Type;
       string URI;
       Item Itm;
-      char *C = Buffer;
+      const char *C = Buffer;
       if (ParseQuoteWord(C,Type) == false)
         return _error->Error("Malformed line %u in source list %s (type)",CurLine,File.c_str());
       if (ParseQuoteWord(C,URI) == false)
@@ -169,7 +169,12 @@ string pkgSourceList::Item::PackagesURI() const
    {
       case Deb:
       if (Dist[Dist.size() - 1] == '/')
-        Res = URI + Dist;
+      {
+        if (Dist != "/")
+           Res = URI + Dist;
+        else 
+           Res = URI;
+      }      
       else
         Res = URI + "dists/" + Dist + '/' + Section +
         "/binary-" + _config->Find("APT::Architecture") + '/';
@@ -201,7 +206,10 @@ string pkgSourceList::Item::PackagesInfo() const
       case Deb:
       Res += SiteOnly(URI) + ' ';
       if (Dist[Dist.size() - 1] == '/')
-        Res += Dist;
+      {
+        if (Dist != "/")
+           Res += Dist;
+      }      
       else
         Res += Dist + '/' + Section;
       
@@ -231,7 +239,12 @@ string pkgSourceList::Item::ReleaseURI() const
    {
       case Deb:
       if (Dist[Dist.size() - 1] == '/')
-        Res = URI + Dist;
+      {
+        if (Dist != "/")
+           Res = URI + Dist;
+        else
+           Res = URI;
+      }      
       else
         Res = URI + "dists/" + Dist + '/' + Section +
         "/binary-" + _config->Find("APT::Architecture") + '/';
@@ -264,7 +277,10 @@ string pkgSourceList::Item::ReleaseInfo() const
       case DebSrc:
       Res += SiteOnly(URI) + ' ';
       if (Dist[Dist.size() - 1] == '/')
-        Res += Dist;
+      {
+        if (Dist != "/")
+           Res += Dist;
+      }      
       else
         Res += Dist + '/' + Section;
       
@@ -286,7 +302,10 @@ string pkgSourceList::Item::ArchiveInfo(pkgCache::VerIterator Ver) const
       case Deb:
       Res += SiteOnly(URI) + ' ';
       if (Dist[Dist.size() - 1] == '/')
-        Res += Dist;
+      {
+        if (Dist != "/")
+           Res += Dist;
+      }      
       else
         Res += Dist + '/' + Section;
       
@@ -328,7 +347,10 @@ string pkgSourceList::Item::SourceInfo(string Pkg,string Ver,string Comp) const
       case Deb:
       Res += SiteOnly(URI) + ' ';
       if (Dist[Dist.size() - 1] == '/')
-        Res += Dist;
+      {
+        if (Dist != "/")
+           Res += Dist;
+      }      
       else
         Res += Dist + '/' + Section;