rewrite also URLs ending with /
authorStanislav Visnovsky <visnov@suse.cz>
Mon, 13 Feb 2006 08:39:20 +0000 (08:39 +0000)
committerStanislav Visnovsky <visnov@suse.cz>
Mon, 13 Feb 2006 08:39:20 +0000 (08:39 +0000)
zypp/source/MediaSet.cc

index 9a9b4dc..382e2a1 100644 (file)
@@ -83,12 +83,12 @@ namespace zypp
       DBG << "Rewriting url " << url_r << endl;
 
       std::string pathname = url_r.getPathName();
-      boost::regex e("^(.*)[0-9]+$");
+      boost::regex e("^(.*)[0-9]+(/?)$");
       boost::smatch what;
       if(boost::regex_match(pathname, what, e, boost::match_extra))
       {
        std::string base = what[1];
-       pathname = base + str::numstring(medianr);
+       pathname = base + str::numstring(medianr) + what[2];
        Url url = url_r;
        url.setPathName (pathname);