summaryrefslogtreecommitdiff
path: root/apt-pkg/contrib
diff options
context:
space:
mode:
Diffstat (limited to 'apt-pkg/contrib')
-rw-r--r--apt-pkg/contrib/strutl.cc12
-rw-r--r--apt-pkg/contrib/strutl.h1
2 files changed, 13 insertions, 0 deletions
diff --git a/apt-pkg/contrib/strutl.cc b/apt-pkg/contrib/strutl.cc
index 2913fbf44..8e8820949 100644
--- a/apt-pkg/contrib/strutl.cc
+++ b/apt-pkg/contrib/strutl.cc
@@ -1323,3 +1323,15 @@ string URI::SiteOnly(const string &URI)
return U;
}
/*}}}*/
+// URI::NoUserPassword - Return the schema, site and path for the URI /*{{{*/
+// ---------------------------------------------------------------------
+/* */
+string URI::NoUserPassword(const string &URI)
+{
+ ::URI U(URI);
+ U.User.clear();
+ U.Password.clear();
+ U.Port = 0;
+ return U;
+}
+ /*}}}*/
diff --git a/apt-pkg/contrib/strutl.h b/apt-pkg/contrib/strutl.h
index 2b2e147fb..a1e7f3934 100644
--- a/apt-pkg/contrib/strutl.h
+++ b/apt-pkg/contrib/strutl.h
@@ -120,6 +120,7 @@ class URI
inline void operator =(const string &From) {CopyFrom(From);};
inline bool empty() {return Access.empty();};
static string SiteOnly(const string &URI);
+ static string NoUserPassword(const string &URI);
URI(string Path) {CopyFrom(Path);};
URI() : Port(0) {};