Url parsing fix
authorArch Librarian <arch@canonical.com>
Mon, 20 Sep 2004 16:54:04 +0000 (16:54 +0000)
committerArch Librarian <arch@canonical.com>
Mon, 20 Sep 2004 16:54:04 +0000 (16:54 +0000)
Author: jgg
Date: 1999-06-24 04:34:25 GMT
Url parsing fix

apt-pkg/contrib/strutl.cc
debian/changelog
test/scratch.cc

index 2411623..a1c6058 100644 (file)
@@ -1,6 +1,6 @@
 // -*- mode: cpp; mode: fold -*-
 // Description                                                         /*{{{*/
-// $Id: strutl.cc,v 1.24 1999/04/04 08:07:39 jgg Exp $
+// $Id: strutl.cc,v 1.25 1999/06/24 04:34:25 jgg Exp $
 /* ######################################################################
 
    String Util - Some usefull string functions.
@@ -705,16 +705,15 @@ void URI::CopyFrom(string U)
    if (FirstColon > SingleSlash)
       FirstColon = SingleSlash;
    
-   // Search for the @
-   I = FirstColon;
+   // Find the colon...
+   I = FirstColon + 1;
+   for (; I < SingleSlash && *I != ':'; I++);
+   string::const_iterator SecondColon = I;
+   
+   // Search for the @ after the colon
    for (; I < SingleSlash && *I != '@'; I++);
    string::const_iterator At = I;
    
-   // Colon in the @ section
-   I = FirstColon + 1;
-   for (; I < At && *I != ':'; I++);
-   string::const_iterator SecondColon = I;
-      
    // Now write the host and user/pass
    if (At == SingleSlash)
    {
index 9acc80e..327c7ab 100644 (file)
@@ -5,6 +5,7 @@ apt (0.3.7.1) unstable; urgency=low
     default config file. Closes: #40011
   * Simulate works for autoclean. Closes: #39141
   * Fixed spelling errors. Closes: #39673
+  * Changed url parsing a bit. Closes: #40070, #40069
   
  -- Ben Gertzfield <che@debian.org>  Sun, 20 Jun 1999 18:36:20 -0700
 
index dc02e05..d3ca58a 100644 (file)
@@ -1,10 +1,20 @@
 #include <apt-pkg/tagfile.h>
+#include <apt-pkg/strutl.h>
 
 #include <signal.h>
 #include <stdio.h>
 
 int main(int argc,char *argv[])
 {
+   URI U(argv[1]);
+   cout << U.Access << endl;
+   cout << U.User << endl;
+   cout << U.Password << endl;
+   cout << U.Host << endl;
+   cout << U.Path << endl;
+   cout << U.Port << endl;
+      
+/*   
    FileFd F(argv[1],FileFd::ReadOnly);
    pkgTagFile Reader(F);
    
@@ -15,7 +25,7 @@ int main(int argc,char *argv[])
       Sect.FindS("Section");
       Sect.FindS("Version");
       Sect.FindI("Size");
-   };
+   };*/
    
    return 0;
 }