diff options
author | Arch Librarian <arch@canonical.com> | 2004-09-20 16:54:04 +0000 |
---|---|---|
committer | Arch Librarian <arch@canonical.com> | 2004-09-20 16:54:04 +0000 |
commit | 3856756b3469c194ad4f56bf83497f25c42e8253 (patch) | |
tree | d3aa4d1cbbc3b97b6fbe3f5240678cb51a8de01a /apt-pkg | |
parent | c1e78ee5a2697afc0902d1be294d71de93090909 (diff) |
Url parsing fix
Author: jgg
Date: 1999-06-24 04:34:25 GMT
Url parsing fix
Diffstat (limited to 'apt-pkg')
-rw-r--r-- | apt-pkg/contrib/strutl.cc | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/apt-pkg/contrib/strutl.cc b/apt-pkg/contrib/strutl.cc index 2411623c5..a1c605886 100644 --- a/apt-pkg/contrib/strutl.cc +++ b/apt-pkg/contrib/strutl.cc @@ -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) { |