changeset 4344:26a2fa9433b8

hgweb: make PATH_INFO handling slightly more robust
author Matt Mackall <mpm@selenic.com>
date Thu, 12 Apr 2007 11:00:21 -0500
parents 66a3fe30f9fc
children 9bfe93edfbb0
files mercurial/hgweb/hgweb_mod.py
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/hgweb/hgweb_mod.py
+++ b/mercurial/hgweb/hgweb_mod.py
@@ -716,7 +716,7 @@ class hgweb(object):
                     # strip leading /
                     pi = pi[1:]
                     if pi:
-                        root = root[:-len(pi)]
+                        root = root[:root.rfind(root, pi)]
                     if req.env.has_key('REPO_NAME'):
                         rn = req.env['REPO_NAME'] + '/'
                         root += rn