diff options
author | Arch Librarian <arch@canonical.com> | 2004-09-20 16:51:18 +0000 |
---|---|---|
committer | Arch Librarian <arch@canonical.com> | 2004-09-20 16:51:18 +0000 |
commit | 492f957ad42ce5eee7e26f3edd5789af296b7460 (patch) | |
tree | b24c42bf1e3a65a75560c0160288ad3405947c33 /apt-pkg/contrib/strutl.cc | |
parent | 8bb5959b7e2637a818d5c3c9cd38b9a1a0287331 (diff) |
Http method
Author: jgg
Date: 1998-11-04 07:10:49 GMT
Http method
Diffstat (limited to 'apt-pkg/contrib/strutl.cc')
-rw-r--r-- | apt-pkg/contrib/strutl.cc | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/apt-pkg/contrib/strutl.cc b/apt-pkg/contrib/strutl.cc index 5efa6f60b..c99f88c3f 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.11 1998/11/01 08:07:12 jgg Exp $ +// $Id: strutl.cc,v 1.12 1998/11/04 07:11:13 jgg Exp $ /* ###################################################################### String Util - Some usefull string functions. @@ -15,13 +15,16 @@ ##################################################################### */ /*}}}*/ // Includes /*{{{*/ +#ifdef __GNUG__ +#pragma implementation "strutl.h" +#endif + #include <strutl.h> #include <apt-pkg/fileutl.h> #include <ctype.h> #include <string.h> #include <stdio.h> -#include <time.h> /*}}}*/ // strstrip - Remove white space from the front and back of a string /*{{{*/ @@ -695,6 +698,7 @@ URI::operator string() string Res = Access + ':'; if (Host.empty() == false) { + Res += "//"; if (User.empty() == false) { Res += "//" + User; @@ -703,10 +707,21 @@ URI::operator string() Res += "@"; } Res += Host; + if (Port != 0) + { + char S[30]; + sprintf(S,":%u",Port); + Res += S; + } } if (Path.empty() == false) - Res += "/" + Path; + { + if (Path[0] != '/') + Res += "/" + Path; + else + Res += Path; + } return Res; } |