diff options
author | Arch Librarian <arch@canonical.com> | 2004-09-20 16:51:17 +0000 |
---|---|---|
committer | Arch Librarian <arch@canonical.com> | 2004-09-20 16:51:17 +0000 |
commit | 92e889c8856ce16f58cf6aefb7f11f0ff189be29 (patch) | |
tree | c2fbdc291ce9b34a66e669ff21f7c7a990828939 /apt-pkg/contrib/strutl.cc | |
parent | be4401bfa4a240bbc894e1bfeb1e1e8d63fc7b18 (diff) |
HTTP bugs
Author: jgg
Date: 1998-11-01 08:07:11 GMT
HTTP bugs
Diffstat (limited to 'apt-pkg/contrib/strutl.cc')
-rw-r--r-- | apt-pkg/contrib/strutl.cc | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/apt-pkg/contrib/strutl.cc b/apt-pkg/contrib/strutl.cc index 2c3106ceb..5efa6f60b 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.10 1998/11/01 05:27:37 jgg Exp $ +// $Id: strutl.cc,v 1.11 1998/11/01 08:07:12 jgg Exp $ /* ###################################################################### String Util - Some usefull string functions. @@ -627,7 +627,7 @@ void URI::CopyFrom(string U) // Locate the single / that starts the path for (; I < U.end(); I++) { - if (*I == '/' && I[1] == '/') + if (*I == '/' && I+1 < U.end() && I[1] == '/') I += 2; else if (*I == '/') @@ -641,8 +641,10 @@ void URI::CopyFrom(string U) // We can now write the access and path specifiers Access = string(U,0,FirstColon - U.begin()); if (SingleSlash != U.end()) - Path = string(U,SingleSlash - U.begin() + 1); - + Path = string(U,SingleSlash - U.begin()); + if (Path.empty() == true) + Path = "/"; + // Now we attempt to locate a user:pass@host fragment FirstColon += 3; if (FirstColon >= U.end()) |