]> granicus.if.org Git - python/commitdiff
Fix the way a trailing / is changed to /index.html so that it
authorGuido van Rossum <guido@python.org>
Mon, 15 Jun 1998 12:34:41 +0000 (12:34 +0000)
committerGuido van Rossum <guido@python.org>
Mon, 15 Jun 1998 12:34:41 +0000 (12:34 +0000)
doesn't depend on the value of os.sep.  (I.e. ported to Windows :-)

Tools/webchecker/websucker.py

index 852df07dc41b76e51652c6d73b77b101a126dd94..7ee25359ca738c3f657765d79d30b2f25fbf7a95 100755 (executable)
@@ -85,10 +85,11 @@ class Sucker(webchecker.Checker):
         user, host = urllib.splituser(host)
         host, port = urllib.splitnport(host)
         host = string.lower(host)
-        path = os.path.join(host, path)
-        if path[-1] == "/": path = path + "index.html"
+        if not path or path[-1] == "/":
+               path = path + "index.html"
         if os.sep != "/":
             path = string.join(string.split(path, "/"), os.sep)
+        path = os.path.join(host, path)
         return path
 
 def makedirs(dir):