From 54cf15cb909b722a69d73850ad66bfad6cee66fa Mon Sep 17 00:00:00 2001 From: Arch Librarian Date: Mon, 20 Sep 2004 16:54:51 +0000 Subject: Beautified URI printing to not include passwords Author: jgg Date: 1999-10-17 07:30:23 GMT Beautified URI printing to not include passwords --- apt-pkg/sourcelist.cc | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) (limited to 'apt-pkg/sourcelist.cc') 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; } /*}}}*/ -- cgit v1.2.3