diff options
author | Arch Librarian <arch@canonical.com> | 2004-09-20 16:54:51 +0000 |
---|---|---|
committer | Arch Librarian <arch@canonical.com> | 2004-09-20 16:54:51 +0000 |
commit | 54cf15cb909b722a69d73850ad66bfad6cee66fa (patch) | |
tree | edc1ffb181372cd4be74c0e7af0d0c08e5ac8f23 /apt-pkg/sourcelist.cc | |
parent | 31a0531ddea0f1737b607cde4ae40c22493bf72c (diff) |
Beautified URI printing to not include passwords
Author: jgg
Date: 1999-10-17 07:30:23 GMT
Beautified URI printing to not include passwords
Diffstat (limited to 'apt-pkg/sourcelist.cc')
-rw-r--r-- | apt-pkg/sourcelist.cc | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/apt-pkg/sourcelist.cc b/apt-pkg/sourcelist.cc index 48d32f908..1fdbd834e 100644 --- a/apt-pkg/sourcelist.cc +++ b/apt-pkg/sourcelist.cc @@ -1,6 +1,6 @@ // -*- mode: cpp; mode: fold -*- // Description /*{{{*/ -// $Id: sourcelist.cc,v 1.16 1999/09/30 06:30:34 jgg Exp $ +// $Id: sourcelist.cc,v 1.17 1999/10/17 07:30:23 jgg Exp $ /* ###################################################################### List of Sources @@ -370,15 +370,11 @@ string pkgSourceList::Item::SourceInfo(string Pkg,string Ver,string Comp) const /* */ string pkgSourceList::Item::SiteOnly(string URI) const { - unsigned int Pos = URI.find(':'); - if (Pos == string::npos || Pos + 3 > URI.length()) - return URI; - if (URI[Pos + 1] != '/' || URI[Pos + 2] != '/') - return URI; - - Pos = URI.find('/',Pos + 3); - if (Pos == string::npos) - return URI; - return string(URI,0,Pos); + ::URI U(URI); + U.User = string(); + U.Password = string(); + U.Path = string(); + U.Port = 0; + return U; } /*}}}*/ |