summaryrefslogtreecommitdiff
path: root/apt-pkg/contrib/strutl.cc
diff options
context:
space:
mode:
authorArch Librarian <arch@canonical.com>2004-09-20 16:51:20 +0000
committerArch Librarian <arch@canonical.com>2004-09-20 16:51:20 +0000
commitbfd22fc0ac2632c6196f5149dc3b3671d9ff15e0 (patch)
tree2affe097f22065e344d2fc8921049ea7e3185d9b /apt-pkg/contrib/strutl.cc
parent46976ca4e7393625fb25728d876e0c15b7e55c15 (diff)
Working acquire code
Author: jgg Date: 1998-11-05 07:21:35 GMT Working acquire code
Diffstat (limited to 'apt-pkg/contrib/strutl.cc')
-rw-r--r--apt-pkg/contrib/strutl.cc23
1 files changed, 7 insertions, 16 deletions
diff --git a/apt-pkg/contrib/strutl.cc b/apt-pkg/contrib/strutl.cc
index c99f88c3f..d5f765dd4 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.12 1998/11/04 07:11:13 jgg Exp $
+// $Id: strutl.cc,v 1.13 1998/11/05 07:21:44 jgg Exp $
/* ######################################################################
String Util - Some usefull string functions.
@@ -623,23 +623,14 @@ void URI::CopyFrom(string U)
for (; I < U.end() && *I != ':' ; I++);
string::const_iterator FirstColon = I;
- // Determine if this is a host type URI with a leading double //
+ /* Determine if this is a host type URI with a leading double //
+ and then search for the first single / */
string::const_iterator SingleSlash = I;
if (I + 3 < U.end() && I[1] == '/' && I[2] == '/')
- {
- // Locate the single / that starts the path
- for (; I < U.end(); I++)
- {
- if (*I == '/' && I+1 < U.end() && I[1] == '/')
- I += 2;
- else
- if (*I == '/')
- break;
- }
- if (I > U.end())
- I = U.end();
- SingleSlash = I;
- }
+ SingleSlash += 3;
+ for (; SingleSlash < U.end() && *SingleSlash != '/'; SingleSlash++);
+ if (SingleSlash > U.end())
+ SingleSlash = U.end();
// We can now write the access and path specifiers
Access = string(U,0,FirstColon - U.begin());